Grouping radio buttons in repeating section

N

NAT

I have a repeating section. In this section there is a table of one row.Now
the first column is a radio button. Since this is a repeating section so I do
not know the no. of rows that can be at a time. I want the user to select a
row by clicking on the radio button (first column). But since the radio
buttons cannot be grouped here. I want to user to select only one radio
button at a time. Is there any way I can acheive the grouping of the radio
buttons in this scenario ?

Thanks in advance
 
G

Greg Collins [InfoPath MVP]

You need to write your own OnAfterChange code which deselects any existing radio button selection after the user selects another one. Unfortunately this is the only way to do this right now without doing some custom work in the XSL itself.
 
N

NAT

I tried that . But since this is a onafterchange event so the moment I
deselect the button using my code the event gets fired automatically.i.e. it
becomes recursive and hence goes into infinite loop. I also tried in other
event "Onbefore" but here the DOM is ReadOnly and so does not allow me to do
so. Any solution ?
 
G

Greg Collins [InfoPath MVP]

Yes - sorry, I should have thought about that.

You need to set a flag (a global Boolean variable which is used to determine whether YOU are making the value change in code, or whether the USER made the change by clicking on it. If the value is true, you ignore the change and return from the function, if it is false, you continue with the OnAfterChange event as normal.

Just before you change the value in code, you set your flag to true, and as soon as you are done, you set it back to false.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top