Group Checkboxes- set default and run time values to checkbox component

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Group Checkboxes- set default and run time values to checkbox component

Sachin B
Hi Alex

I have to use multiselect checkbox in a form

My use case is as below:

e.g Hobbies:  []Cricket  []Chess []Football []Tennis

1) it should support single select
2) it should support multi select
3) On form load I am going to call an Action which will get some data using service & will set to form fields.
        So for check box also lets say service return data like [ chess, Football] &  I have to set it in action response control value.

        So what would be the xpath expression to set such multiple values array to this check box.
       
Please let me know so that I can use this check boxes in my form & can also handle form load with default data for fields including checkbox.


Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Group Checkboxes- set default and run time values to checkbox component

Alessandro  Vernet
Administrator
Hi Sachin,

The XPath you write should return a space-separated list of values, i.e. corresponding to the values you entered in Form Builder's Edit Choices dialog. For instance, in your case, you might have entered the following pairs of labels/values in Form Builder:

- Cricket / cr
- Chess / ch
- Football / fo
- Tennis / te

If you want to the value to be Cricket + Football, the XPath should return "cr fo".

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Group Checkboxes- set default and run time values to checkbox component

Sachin B
Thanks Alex. It's working for me.

Also I want single selection on check box group. For now we can select multiple options in a group of check boxes.

How can we do it?
Reply | Threaded
Open this post in threaded view
|

Re: Group Checkboxes- set default and run time values to checkbox component

Alessandro  Vernet
Administrator
Hi Sachin,

If I understand you well, in this case you should use radio buttons. Check boxes are form multiple sections, while radio buttons are for single selection.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Group Checkboxes- set default and run time values to checkbox component

Sachin B
Thanks Alex.