[ops-users] Problem with Two-Tier Dropdowns

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

[ops-users] Problem with Two-Tier Dropdowns

Mackinnon, Mark A.
OK, apparently there is no facility for attaching a file when posyting here, so
here is my XForm in-line:

<html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:xf="http://www.w3.org/2002/xforms"
            xmlns:ev="http://www.w3.org/2001/xml-events"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<head>
<title>Two Tier test</title>
<xf:model>
<xf:instance id="Main">
<Test xmlns="">
<VehicleMakeOne/>
<VehicleModelOne/>
<VehicleMakeTwo/>
<VehicleModelTwo/>
</Test>
</xf:instance>
<xf:instance id="VehicleMakes">
<VehicleMakeCodes xmlns="">
<Entry code="" name=""/>
<Entry code="AUDI" name="Audi"/>
<Entry code="BMW" name="BMW"/>
<Entry code="CHEV" name="Chevrolet"/>
</VehicleMakeCodes>
</xf:instance>
<xf:instance id="VehicleModelsSimple">
<VehicleModelCodes xmlns="">
<Entry make="" code="" model=""/>
<Entry make="AUDI" code="1st Audi Model" model="1st Audi Model"/>
<Entry make="AUDI" code="2nd Audi Model" model="2nd Audi Model"/>
<Entry make="AUDI" code="3rd Audi Model" model="3rd Audi Model"/>
<Entry make="BMW" code="1st and Only BMW Model" model="1st and Only BMW
Model"/>
<Entry make="CHEV" code="1st Chevy Model" model="1st Chevy Model"/>
<Entry make="CHEV" code="2nd Chevy Model" model="2nd Chevy Model"/>
<Entry make="CHEV" code="3rd Chevy Model" model="3rd Chevy Model"/>
<Entry make="CHEV" code="4th Chevy Model" model="4th Chevy Model"/>
</VehicleModelCodes>
</xf:instance>
<xf:instance id="VehicleModelsExpanded">
<VehicleModelCodes xmlns="">
<Entry make="" code="" model=""/>
<Entry make="AUDI" code="" model="Choose from list"/>
<Entry make="AUDI" code="1st Audi Model" model="1st Audi Model"/>
<Entry make="AUDI" code="2nd Audi Model" model="2nd Audi Model"/>
<Entry make="AUDI" code="3rd Audi Model" model="3rd Audi Model"/>
<Entry make="BMW" code="" model="Choose from list"/>
<Entry make="BMW" code="1st and Only BMW Model" model="1st and Only BMW
Model"/>
<Entry make="CHEV" code="" model="Choose from list"/>
<Entry make="CHEV" code="1st Chevy Model" model="1st Chevy Model"/>
<Entry make="CHEV" code="2nd Chevy Model" model="2nd Chevy Model"/>
<Entry make="CHEV" code="3rd Chevy Model" model="3rd Chevy Model"/>
<Entry make="CHEV" code="4th Chevy Model" model="4th Chevy Model"/>
</VehicleModelCodes>
</xf:instance>
<xf:submission id="submit-test" method="post" ref="/Test"
action="http://www.xformstest.org/cgi-bin/echo.sh" />
</xf:model>
</head>
<body>
<fieldset>
<legend>Problem One</legend>
<xf:select1 ref="VehicleMakeOne">
<xf:label>Make: </xf:label>
<xf:itemset nodeset="instance('VehicleMakes')/Entry">
<xf:label ref="@name"/>
<xf:value ref="@code"/>
</xf:itemset>
</xf:select1>
<xf:select1 ref="VehicleModelOne">
<xf:label>Model: </xf:label>
<xf:itemset nodeset="instance('VehicleModelsSimple')/Entry[@make =
instance('Main')/VehicleMakeOne]">
<xf:label ref="@model"/>
<xf:value ref="@code"/>
</xf:itemset>
</xf:select1>
<xf:output ref="VehicleModelOne">
<xf:label>What gets stored in instance: </xf:label>
</xf:output>
</fieldset>
<fieldset>
<legend>Problem Two</legend>
<xf:select1 ref="VehicleMakeTwo">
<xf:label>Make: </xf:label>
<xf:itemset nodeset="instance('VehicleMakes')/Entry">
<xf:label ref="@name"/>
<xf:value ref="@code"/>
</xf:itemset>
</xf:select1>
<xf:select1 ref="VehicleModelTwo">
<xf:label>Model: </xf:label>
<xf:itemset nodeset="instance('VehicleModelsExpanded')/Entry[@make =
instance('Main')/VehicleMakeTwo]">
<xf:label ref="@model"/>
<xf:value ref="@code"/>
</xf:itemset>
</xf:select1>
<xf:output ref="VehicleModelTwo">
<xf:label>What gets stored in instance: </xf:label>
</xf:output>
</fieldset>
<P>
<xf:submit submission="submit-test">
<xf:label>Submit the Form</xf:label>
</xf:submit>
</P>
</body>
</html>


--
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
Reply | Threaded
Open this post in threaded view
|

Re: Problem with Two-Tier Dropdowns

Erik Bruchez
Administrator
Mark,

Did you solve this problem or is this still current?

-Erik

Mark MacKinnon wrote:

> OK, apparently there is no facility for attaching a file when posyting here, so
> here is my XForm in-line:
>
> <html xmlns="http://www.w3.org/1999/xhtml"
>    xmlns:xf="http://www.w3.org/2002/xforms"
>    xmlns:ev="http://www.w3.org/2001/xml-events"
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
> <head>
> <title>Two Tier test</title>
> <xf:model>
> <xf:instance id="Main">
> <Test xmlns="">
> <VehicleMakeOne/>
> <VehicleModelOne/>
> <VehicleMakeTwo/>
> <VehicleModelTwo/>
> </Test>
> </xf:instance>
> <xf:instance id="VehicleMakes">
> <VehicleMakeCodes xmlns="">
> <Entry code="" name=""/>
> <Entry code="AUDI" name="Audi"/>
> <Entry code="BMW" name="BMW"/>
> <Entry code="CHEV" name="Chevrolet"/>
> </VehicleMakeCodes>
> </xf:instance>
> <xf:instance id="VehicleModelsSimple">
> <VehicleModelCodes xmlns="">
> <Entry make="" code="" model=""/>
> <Entry make="AUDI" code="1st Audi Model" model="1st Audi Model"/>
> <Entry make="AUDI" code="2nd Audi Model" model="2nd Audi Model"/>
> <Entry make="AUDI" code="3rd Audi Model" model="3rd Audi Model"/>
> <Entry make="BMW" code="1st and Only BMW Model" model="1st and Only BMW
> Model"/>
> <Entry make="CHEV" code="1st Chevy Model" model="1st Chevy Model"/>
> <Entry make="CHEV" code="2nd Chevy Model" model="2nd Chevy Model"/>
> <Entry make="CHEV" code="3rd Chevy Model" model="3rd Chevy Model"/>
> <Entry make="CHEV" code="4th Chevy Model" model="4th Chevy Model"/>
> </VehicleModelCodes>
> </xf:instance>
> <xf:instance id="VehicleModelsExpanded">
> <VehicleModelCodes xmlns="">
> <Entry make="" code="" model=""/>
> <Entry make="AUDI" code="" model="Choose from list"/>
> <Entry make="AUDI" code="1st Audi Model" model="1st Audi Model"/>
> <Entry make="AUDI" code="2nd Audi Model" model="2nd Audi Model"/>
> <Entry make="AUDI" code="3rd Audi Model" model="3rd Audi Model"/>
> <Entry make="BMW" code="" model="Choose from list"/>
> <Entry make="BMW" code="1st and Only BMW Model" model="1st and Only BMW
> Model"/>
> <Entry make="CHEV" code="" model="Choose from list"/>
> <Entry make="CHEV" code="1st Chevy Model" model="1st Chevy Model"/>
> <Entry make="CHEV" code="2nd Chevy Model" model="2nd Chevy Model"/>
> <Entry make="CHEV" code="3rd Chevy Model" model="3rd Chevy Model"/>
> <Entry make="CHEV" code="4th Chevy Model" model="4th Chevy Model"/>
> </VehicleModelCodes>
> </xf:instance>
> <xf:submission id="submit-test" method="post" ref="/Test"
> action="http://www.xformstest.org/cgi-bin/echo.sh" />
> </xf:model>
> </head>
> <body>
> <fieldset>
> <legend>Problem One</legend>
> <xf:select1 ref="VehicleMakeOne">
> <xf:label>Make: </xf:label>
> <xf:itemset nodeset="instance('VehicleMakes')/Entry">
> <xf:label ref="@name"/>
> <xf:value ref="@code"/>
> </xf:itemset>
> </xf:select1>
> <xf:select1 ref="VehicleModelOne">
> <xf:label>Model: </xf:label>
> <xf:itemset nodeset="instance('VehicleModelsSimple')/Entry[@make =
> instance('Main')/VehicleMakeOne]">
> <xf:label ref="@model"/>
> <xf:value ref="@code"/>
> </xf:itemset>
> </xf:select1>
> <xf:output ref="VehicleModelOne">
> <xf:label>What gets stored in instance: </xf:label>
> </xf:output>
> </fieldset>
> <fieldset>
> <legend>Problem Two</legend>
> <xf:select1 ref="VehicleMakeTwo">
> <xf:label>Make: </xf:label>
> <xf:itemset nodeset="instance('VehicleMakes')/Entry">
> <xf:label ref="@name"/>
> <xf:value ref="@code"/>
> </xf:itemset>
> </xf:select1>
> <xf:select1 ref="VehicleModelTwo">
> <xf:label>Model: </xf:label>
> <xf:itemset nodeset="instance('VehicleModelsExpanded')/Entry[@make =
> instance('Main')/VehicleMakeTwo]">
> <xf:label ref="@model"/>
> <xf:value ref="@code"/>
> </xf:itemset>
> </xf:select1>
> <xf:output ref="VehicleModelTwo">
> <xf:label>What gets stored in instance: </xf:label>
> </xf:output>
> </fieldset>
> <P>
> <xf:submit submission="submit-test">
> <xf:label>Submit the Form</xf:label>
> </xf:submit>
> </P>
> </body>
> </html>
>

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/


--
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
Reply | Threaded
Open this post in threaded view
|

RE: Problem with Two-Tier Dropdowns

Mackinnon, Mark A.
Hi, Erik
 
Yes, Allessandro sent me the fix last week, which I successfully implemented on my larger instance.  The key (for anyone else out there that didn't see the solution) was to add this action statement between the end ItemSet and end Select1 tags on the 1st-tier dropdown:
 
                 <xf:action ev:event="xforms-value-changed">
                     <xf:setvalue ref="../VehicleModelOne"
value="instance('VehicleModelsSimple')/Entry[@make=instance('Main')/
VehicleMakeOne]/@model"/>
                 </xf:action>

This sets the (starting) value for the 2nd-tier dropdown based on the selection in the 1st-tier.
 
Thanks,
Mark

________________________________

From: [hidden email] on behalf of Erik Bruchez
Sent: Thu 10/11/2007 7:48 PM
To: [hidden email]
Subject: Re: [ops-users] Problem with Two-Tier Dropdowns



Mark,

Did you solve this problem or is this still current?

-Erik

Mark MacKinnon wrote:

> OK, apparently there is no facility for attaching a file when posyting here, so
> here is my XForm in-line:
>
> <html xmlns="http://www.w3.org/1999/xhtml"
>           xmlns:xf="http://www.w3.org/2002/xforms"
>           xmlns:ev="http://www.w3.org/2001/xml-events"
>           xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>           xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
> <head>
> <title>Two Tier test</title>
> <xf:model>
> <xf:instance id="Main">
> <Test xmlns="">
> <VehicleMakeOne/>
> <VehicleModelOne/>
> <VehicleMakeTwo/>
> <VehicleModelTwo/>
> </Test>
> </xf:instance>
> <xf:instance id="VehicleMakes">
> <VehicleMakeCodes xmlns="">
> <Entry code="" name=""/>
> <Entry code="AUDI" name="Audi"/>
> <Entry code="BMW" name="BMW"/>
> <Entry code="CHEV" name="Chevrolet"/>
> </VehicleMakeCodes>
> </xf:instance>
> <xf:instance id="VehicleModelsSimple">
> <VehicleModelCodes xmlns="">
> <Entry make="" code="" model=""/>
> <Entry make="AUDI" code="1st Audi Model" model="1st Audi Model"/>
> <Entry make="AUDI" code="2nd Audi Model" model="2nd Audi Model"/>
> <Entry make="AUDI" code="3rd Audi Model" model="3rd Audi Model"/>
> <Entry make="BMW" code="1st and Only BMW Model" model="1st and Only BMW
> Model"/>
> <Entry make="CHEV" code="1st Chevy Model" model="1st Chevy Model"/>
> <Entry make="CHEV" code="2nd Chevy Model" model="2nd Chevy Model"/>
> <Entry make="CHEV" code="3rd Chevy Model" model="3rd Chevy Model"/>
> <Entry make="CHEV" code="4th Chevy Model" model="4th Chevy Model"/>
> </VehicleModelCodes>
> </xf:instance>
> <xf:instance id="VehicleModelsExpanded">
> <VehicleModelCodes xmlns="">
> <Entry make="" code="" model=""/>
> <Entry make="AUDI" code="" model="Choose from list"/>
> <Entry make="AUDI" code="1st Audi Model" model="1st Audi Model"/>
> <Entry make="AUDI" code="2nd Audi Model" model="2nd Audi Model"/>
> <Entry make="AUDI" code="3rd Audi Model" model="3rd Audi Model"/>
> <Entry make="BMW" code="" model="Choose from list"/>
> <Entry make="BMW" code="1st and Only BMW Model" model="1st and Only BMW
> Model"/>
> <Entry make="CHEV" code="" model="Choose from list"/>
> <Entry make="CHEV" code="1st Chevy Model" model="1st Chevy Model"/>
> <Entry make="CHEV" code="2nd Chevy Model" model="2nd Chevy Model"/>
> <Entry make="CHEV" code="3rd Chevy Model" model="3rd Chevy Model"/>
> <Entry make="CHEV" code="4th Chevy Model" model="4th Chevy Model"/>
> </VehicleModelCodes>
> </xf:instance>
> <xf:submission id="submit-test" method="post" ref="/Test"
> action="http://www.xformstest.org/cgi-bin/echo.sh" />
> </xf:model>
> </head>
> <body>
> <fieldset>
> <legend>Problem One</legend>
> <xf:select1 ref="VehicleMakeOne">
> <xf:label>Make: </xf:label>
> <xf:itemset nodeset="instance('VehicleMakes')/Entry">
> <xf:label ref="@name"/>
> <xf:value ref="@code"/>
> </xf:itemset>
> </xf:select1>
> <xf:select1 ref="VehicleModelOne">
> <xf:label>Model: </xf:label>
> <xf:itemset nodeset="instance('VehicleModelsSimple')/Entry[@make =
> instance('Main')/VehicleMakeOne]">
> <xf:label ref="@model"/>
> <xf:value ref="@code"/>
> </xf:itemset>
> </xf:select1>
> <xf:output ref="VehicleModelOne">
> <xf:label>What gets stored in instance: </xf:label>
> </xf:output>
> </fieldset>
> <fieldset>
> <legend>Problem Two</legend>
> <xf:select1 ref="VehicleMakeTwo">
> <xf:label>Make: </xf:label>
> <xf:itemset nodeset="instance('VehicleMakes')/Entry">
> <xf:label ref="@name"/>
> <xf:value ref="@code"/>
> </xf:itemset>
> </xf:select1>
> <xf:select1 ref="VehicleModelTwo">
> <xf:label>Model: </xf:label>
> <xf:itemset nodeset="instance('VehicleModelsExpanded')/Entry[@make =
> instance('Main')/VehicleMakeTwo]">
> <xf:label ref="@model"/>
> <xf:value ref="@code"/>
> </xf:itemset>
> </xf:select1>
> <xf:output ref="VehicleModelTwo">
> <xf:label>What gets stored in instance: </xf:label>
> </xf:output>
> </fieldset>
> <P>
> <xf:submit submission="submit-test">
> <xf:label>Submit the Form</xf:label>
> </xf:submit>
> </P>
> </body>
> </html>
>

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
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

winmail.dat (11K) Download Attachment