Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 18, 2011 at 03:41 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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!

  • author's profile photo Former Member
    Former Member
    Posted on Apr 18, 2011 at 06:59 AM

    Hi,

    try to set the value as false outside init

    hope this helps

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 18, 2011 at 08:59 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.