Cascading Drop Downs

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

Cascading Drop Downs

Randy Smith-9
All,
Could someone point me in the right direction (examples maybe) on how to
create cascading drop downs? i.e. make one selection which then allows
another selection related to the first.
Thanks,
Randy



--
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: Cascading Drop Downs

Einar Moos
Randy,

I believe Alex posted this a week ago:

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xf="http://www.w3.org/2002/xforms"
    xmlns:ev="http://www.w3.org/2001/xml-events">
    <head>
        <title>Test conditional selection lists</title>
        <xf:model>
           
            <xf:instance id="selected-values" xmlns="">
                <data>
                    <selected>
                        <selected-season>Winter</selected-season>
                        <selected-month>January</selected-month>
                    </selected>
                    <selected>
                        <selected-season>Spring</selected-season>
                        <selected-month>March</selected-month>
                    </selected>
                </data>
            </xf:instance>
           
            <xf:bind id="selected" nodeset="instance('selected-values')/selected">
                <xf:bind id="selected-season" nodeset="selected-season"/>
            </xf:bind>
           
            <xf:instance id="seasons" xmlns="">
                <root>
                    <item name="Spring"/>
                    <item name="Summer"/>
                    <item name="Autumn"/>
                    <item name="Winter"/>
                </root>
            </xf:instance>
           
            <xf:instance id="months" xmlns="">
                <root>
                    <item name="January" season="Winter"/>
                    <item name="February" season="Winter"/>
                    <item name="March" season="Spring"/>
                    <item name="April" season="Spring"/>
                    <item name="May" season="Spring"/>
                    <item name="June" season="Summer"/>
                    <item name="July" season="Summer"/>
                    <item name="August" season="Summer"/>
                    <item name="September" season="Autumn"/>
                    <item name="October" season="Autumn"/>
                    <item name="November" season="Autumn"/>
                    <item name="December" season="Winter"/>
                </root>
            </xf:instance>
        </xf:model>
    </head>
    <body>
        <p>Test conditional selection lists - month selector depends on the current season</p>
        <xf:repeat bind="selected">
            <xf:select1 ref="selected-season">
                <xf:label>Season:</xf:label>
                <xf:itemset nodeset="instance('seasons')/item">
                    <xf:label ref="@name"/>
                    <xf:value ref="@name"/>
                </xf:itemset>
                <xf:action ev:event="xforms-value-changed">
                    <xf:setvalue ref="../selected-month"/>
                </xf:action>
            </xf:select1>
            <br/>
            <xf:select1 ref="selected-month">
                <xf:label>Month:</xf:label>
                <xf:itemset nodeset="instance('months')/item[@season = context()/../selected-season]">
                    <xf:label ref="@name"/>
                    <xf:value ref="@name"/>
                </xf:itemset>
            </xf:select1>
            <br/>
            <xf:output ref="selected-season">
                <xf:label>selected-season:</xf:label>
            </xf:output>
            <br/>
           
            <xf:output ref="selected-month">
                <xf:label>selected-month:</xf:label>
            </xf:output>
           
            <h4>Relevant Months using Repeat</h4>
            <xf:repeat nodeset="instance('months')/item[@season = context()/selected-season]">
                <xf:output ref="@name"/>
            </xf:repeat>
            <hr/>
        </xf:repeat>
       
    </body>
</html>

... but I lost track where...

HTH

-- einar

On Tue, Sep 8, 2009 at 8:55 PM, Randy Smith <[hidden email]> wrote:
All,
Could someone point me in the right direction (examples maybe) on how to create cascading drop downs? i.e. make one selection which then allows another selection related to the first.
Thanks,
Randy



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

Re: Cascading Drop Downs

Alessandro Vernet
Administrator
In reply to this post by Randy Smith-9
Randy,

Randy Smith-9 wrote
Could someone point me in the right direction (examples maybe) on how to
create cascading drop downs? i.e. make one selection which then allows
another selection related to the first.
Also, you can use the yet-to-document <fr:data-bound-select1> component. See an example here:

http://pastie.org/610729

And if you have a relatively recent build, you can see the example running on your machine at:

http://localhost:8080/orbeon/xforms-sandbox/sample/xbl/orbeon/data-bound-select1/data-bound-select1-unittest

Alex
Reply | Threaded
Open this post in threaded view
|

Re: Re: Cascading Drop Downs

Randy Smith-9
Alex, thanks for pointing me in the right direction.
I'm working on integrating it.
Randy

Alessandro Vernet wrote:
Randy,


Randy Smith-9 wrote:
  
Could someone point me in the right direction (examples maybe) on how to 
create cascading drop downs? i.e. make one selection which then allows 
another selection related to the first.

    

Also, you can use the yet-to-document <fr:data-bound-select1> component. See
an example here:

http://pastie.org/610729

And if you have a relatively recent build, you can see the example running
on your machine at:

http://localhost:8080/orbeon/xforms-sandbox/sample/xbl/orbeon/data-bound-select1/data-bound-select1-unittest

Alex

-----
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/
Twitter - http://twitter.com/avernet
  


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