cancel
Showing results for 
Search instead for 
Did you mean: 

Radio button is not displaying properly - buttons are all enabled.

Former Member
0 Kudos

I binded the value of the radiobutton to a context element "selectOption". In the wdDoInit() of the form, I set the value of "selectOption" to false for the user to be able to select one option.

But when I run the application, all the radio buttons in the form are enabled.

Could anybody tell me how to resolve this? Thank you!

Edited by: Heidi Salapong on Apr 18, 2011 8:28 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You have to bind property "selectedKey" of all radio buttons to the same context attribute A (of type string). Then set the property value "keyToSelect" for each radio button to the key (string) used to select this button. Then set the value of context attribute A to the key of the radio button that should be selected initially. Changing the selection on the UI will then update the value of A automatically.

Example: 3 buttons with "keyToSelect" = "a", "b", "c". Bind as described above and set the context attribute to "c": The 3rd button is selected, the first and second are unselected.

Former Member
0 Kudos

Thank you!

The context attribute A is of type boolean.

I set the property "selectedKey" of the radio buttons to the context attribute A.

Then set the property value "keyToSelect" to "true, false".

Then set the value of context attribute A to false.

Now, all radio buttons are set to false.

Thanks a lot for all the solutions!

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Heidi,

Create a boolean context attribute. Map the "readOnly" property of the Radio Button to this context attribute. Set it to true when the component loads. You can set it to true in init method.

Since the readonly value is true at runtime, the radioButton will behave as readOnly during runtime and hence will be disabled.

This should help.

Regards,

Sayan Ghosh

Former Member
0 Kudos

Hi,

try to set the value as false outside init

hope this helps