Hi,
I have a problem with expressions in "calculated value".
I have two sections:
First section $cotrol1: there are 4 checkboxes with values: 1,2,10,11 respectively.
Second section $control2: there are 2 checkboxes with values 1 and 2.
When in first section I'll check checkbox 3 or 4 (values 10 or 11), I need to check checkbox in $control2 with value 2, in other case uncheck all checkboxes in $control2.
Additionally, in section 2 one checkbox can be checked only.
So, in $control2 in Calculated value I entered:
xxf:split()[1],
if (sum(for $v in xxf:split($control1) return number($v)) > 9) then '1' else ''
First expression makes it impossible to check both checkboxes, second expression is responsible for calculating value from $control1 and check/uncheck checkbox.
In this case I cannot check both checkboxes (it's ok), but second expression doesn't work properly: if is true, checkbox is checked, but in else condition, checkbox is not unchecked.
When I remove "xxf:split()[1]," and there is only if ... else .. expression, then it works ok (but I can check both checkboxes - it's not ok).
The problem is when both expressions are entered. Where is an error?
Thanks for help,
Andrzej