Pages

Wednesday, December 29, 2010

Grouping Radio Buttons inside Repeat Control in XPages

When you put a Radio button inside a repeat control in XPages and give it a group name as follows,

we explicitly assume that the radio buttons that get created as a result of the repeat control share the same  group name and behave in a the expected way. Ofcourse there is nothing wrong in expecting that. But its just that we miss a few points that are associated with the way XPages render them- so much for the documentations of XPages..... X(

To my amusement the following is what I experienced

I did panic a bit too but that is hidden :)
The fix that I got from the sources over the internet was to add the Skip Container attribute to the radio button tag.

Click the radio button and choosing its All Properties menu and specifying 1 against the skip containers attribute helped me get the normal functionality in a tricky way X(.

Well probably my words are confusing... Take a look into the following image...

Hope this helps :)

2 comments:

  1. this is what I was lookong for. I am trying, without success, to include radio buttons inside a repeat control. My issue now is that I cannot figure out how to extract the value selected into a scope variable. I have been playing with the tags defaultSelected, value and selectedValue, and assigned a dummy onChange event, to refresh the values. The radios get deselected every time, and the scope variable assigned to the value tag gets erased. Can you help me out? Thanks!

    ReplyDelete
  2. I hope you are having full update selected on the On-Change event of the radio button....

    Create a dummy panel. Give it an ID. and on the onchange event of the radio button, select "Partial Refresh" and mention the id of the dummy panel.

    That should do the trick.

    Try out and let me know if that work. :)

    ReplyDelete