Query possible selections from dropdown

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

Query possible selections from dropdown

criho

Hi,

I guess my problem is rather simple to solve for experienced xpath-ers.

I have a dropdown-control which is automatically filled (labels and values) when loading the form.
How am I able to query if a certain value or label is included in the possible selections? I tried different xpath-functions as collection or contains but they dont have the intended functionality. Thank you.

Christian

CaritasOberösterreich - Jetzt Fan werden

Das Jahresthema 2014 der Caritas in OÖ.: Gemeinsam Familie leben
Es werden keine Bilder angezeigt? Hier klicken

Reply | Threaded
Open this post in threaded view
|

Re: Query possible selections from dropdown

criho
Please help an Orbeon-newbie.
How can i find out which different values are in a dropdown-control?

Thanks, Christian
Reply | Threaded
Open this post in threaded view
|

Re: Query possible selections from dropdown

Alessandro  Vernet
Administrator
Hi Christian,

You can use the xxf:itemset() XPath function for this. For instance, if you have a control named 'a', you can get its items with xxf:itemset('a-control', 'xml')/itemset/choices/item. (Note the '-control' after the control name, as this function takes a control id, and this is how Form Builder generates controls ids from the name you entered.) And for more on the format of the data returned by xxf:itemset(), see:

http://wiki.orbeon.com/forms/doc/developer-guide/xforms-xpath-functions#TOC-xxf:itemset-

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet