-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Robert,
> To make them checkboxes I bound them to xs:boolean: > <xforms:bind nodeset="alcoholic_beverage_items"> > <xforms:bind nodeset="alcoholic_beverage[type='beer']/value" > type="xs:boolean"/> > <xforms:bind nodeset="alcoholic_beverage[type='wine']/value" > type="xs:boolean"/> > <xforms:bind nodeset="alcoholic_beverage[type='liquor']/value" > type="xs:boolean"/> > </xforms:bind> > However when it comes to constraints I don't really know what to do. I > need a check that at least one of them are selected. Otherwise an alert > should show. Anyone with any ideas? (The element structure could be > changed if that would help...) I assume you've defined separate xforms controls for each of the <alcoholic_beverage_items> items. This isn't mandatory. You could alternatively just define one instance node that holds the selected values. For example: <beverages>beer liquor</beverages>. In your XForms code, you could use <xforms:select ref=".../beverages" appearance="full">. This creates checkboxes for each of the selectable items [1]. To define the selectable items, you could either define them inside <xforms:select>...</xforms:select> as shown in the docs [1], or put them into a separate instance and let the xforms engine pull them out using itemset (there's an example how to do this at the bottom of the XForms controls table at [1]). To make at least one selection mandatory, just check if the instance element receiving the selection is empty or not - in my example, just check the <beverages> element for content (e.g. using a bind nodeset="../beverages" constraint="string-length(.) gt 1"). If at least one item is selected, its value is put into that element; multiple items are put together in that element divided by a ' '. hth florian [1] http://www.orbeon.com/orbeon/doc/reference-xforms-guide#xforms-controls-list -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |