A mutually exclusive check box (radio button) in a repeating table/section
Clean XPath only solution. Browser forms OK.
The FORM to try.
Create following field/group structure:
Assign 0 as initial value to rStarter field. Assign following XPath expression as inital value to the ChBx field:
(xdMath:Max(../../my:CheckG/my:rStarter) = ../my:rStarter) and (../my:rStarter != 0)
Create rule at ChBx field.
This rule has 2 actions:
- Assign rStarter to 2 * (. != “false”)
- Assign rStarter to 1 * (. != “false”)
Place control you like (check box or radio button) on the layout. For check box default “Value when cleared” to false and “Value when checked” to true. For radio button limit amount of choices to 1 and set “Value when selected” to true.
Form with more complex behaivior (excludes rows of the same category only, also not tested in SP2010)
Thats it. Happy codeless programming!
P.S. Actually that form looks as potentially a good example to demonstrate field updating concepts like “push” and “pull” and how they are interrelate with each other. In particulary it would be interesting to explain why the sequence of operators like i=2; i=1; which have no sense in any language can be useful thing in Infopath. (Kind of a statement, eh? But that’s fine, hopefully people familiar with volatile variables concept and multithreading are not reading posts about InfoPath :) )