Topic
1 reply Latest Post - ‏2010-08-04T09:53:50Z by Raja_JRF
iHeartLost
iHeartLost
1 Post
ACCEPTED ANSWER

Pinned topic XForms - create different nodes for multiple selections in listbox

‏2010-05-27T22:36:11Z |
Hi all!

I need to create different nodes for multiple selections in listbox!

For the life of me, I can't figure out how. I read somewhere to use with the xforms:select and deselect events.. but I didn't know where to place them, and the places I tried gave me very weird behaviour.

I am currently implementing the following:

<xf:select ref=
"instance('criteria_data')/criteria/criterion" selection=
"" appearance=
"compact" > <xf:label>Choose criteria</xf:label> <xf:itemset nodeset=
"instance('criteria_choices')/choice"> <xf:label ref=
"@label"></xf:label> <xf:value ref=
"."></xf:value> </xf:itemset> </xf:select>

However when multiple choices are submitted, all selection values are inserted into the same node, separated by spaces.

For example:

If AAA and BBB and FFF were selected from listbox, it would result in the following XML:

<criterion>AAA BBB FFF</criterion>

How do I change my code to have each selection be in a separate node?

i.e. I want it to look like this:

<criterion>AAA</criterion> <criterion>BBB</criterion> <criterion>FFF</criterion>

Thanks!
Updated on 2010-08-04T09:53:50Z at 2010-08-04T09:53:50Z by Raja_JRF
  • Raja_JRF
    Raja_JRF
    1 Post
    ACCEPTED ANSWER

    Re: XForms - create different nodes for multiple selections in listbox

    ‏2010-08-04T09:53:50Z  in response to iHeartLost
    Hi !!!
    that is very simple in the itemset option , use "copy " element instead of "value" element... that it. for the reference see the attached xhtml file ..
    By
    Rajamani Marimuthu
    Junior Research Fellow
    Open Technology Centre -NIC
    Gov of India ..