cancel
Showing results for 
Search instead for 
Did you mean: 

Disable 2 radio buttons in a group of 5?

Former Member
0 Kudos

One liner Qs.

Is it possible to disable 2 out of 5 radio buttons in a RadioButtonGroupByKey element?

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

Hi faraz

It's very easy to do with individual radio buttons ... using select key and key to select . properties . if u want to see those radio buttons after disabling you can achieve with radio buttons .......

Attribute R1= selected key and where 'Q1' is key to select

use this code

exe:

if(wdContext.currentContextElement().getR1() == "Q1")

* {*

wdContext.currentContextElement().setR2(null);

* wdContext.currentContextElement().setR3(null)*

* wdContext.currentContextElement().setR4(null);*

wdContext.currentContextElement().setR5(null);

}

when you select one radio button other buttons will dissabled .....

Regards ..

Ramprasad.k

Edited by: Ramprasad K on Sep 29, 2008 10:45 PM

Edited by: Ramprasad K on Sep 29, 2008 10:46 PM

Former Member
0 Kudos

Example:

Context:


-- selectedKey (string)
-- button1Enabled (boolean)
...
-- button5Enabled (boolean)

Data binding:


RadioButton1.selectedKey = @selectedKey
RadioButton1.keyToSelect = "1"
RadioButton1.enabled = @button1Enabled

etc. for other buttons


// select radio button 2:
wdContext.currentContextElement().setSelectedKey("2");
// enable radio button 2:
wdContext.currentContextElement().setButton2Enabled(true);
// etc. for other buttons

Armin

Former Member
0 Kudos

Hi,

The Radio Buttons that you wish to disable in the group has to be mapped with a different context and rest of the radio buttons with another context. For Example if you have group of 5 radio buttons and you wish to disable radio button 1 and 2 then the mapping will be as follows:

Radio Button 1 & 2 ---> Context A

Radio Button 3,4 & 5 --> Context B

Former Member
0 Kudos

Hi Faraz,

You can not disable some radio buttons from a group. For this, you can use individual buttons and can play with their properties.

I hope this helps. If you need some more help, please get back. I'll be happy to help you

Cheers!!!

Umang

Former Member
0 Kudos

"Play with their properties". Wow.

Armin

Former Member
0 Kudos

No. But you can achieve that with individual radio buttons.

Armin

Former Member
0 Kudos
Former Member
0 Kudos

HI,

RadioButtonGroupByKey is having a property called readonly change this to true.

Thanks

Krishna