W3C home > Mailing lists > Public > www-forms@w3.org > October 2005

Re: reload select when selection changes in linked select

From: John Boyer <boyerj@ca.ibm.com>
Date: Mon, 17 Oct 2005 08:29:27 -0700
To: Steve Heron <steven.heron@gmail.com>
Cc: www-forms@w3.org, www-forms-request@w3.org
Message-ID: <OF4495FCEA.8B806068-ON8825709D.00540E4F-8825709D.0055179E@ca.ibm.com>
Hi Steven,

Sounds like you need the typical dynamic UI binding feature of XForms. 
Say you have the following instance data:

<data>
    <manufacturer>A</manufacturer>
    <modelName>a</model>
    <list id='A' name="List A"> <model name='a'/> ...</list>
    <list id='B' name="List B"> ...</list>
    <list id='C' name="List C"> ...</list>
</data>

You could then use the following selectors:

<select1 ref="manufacturer">
     <label>Car Manufacturer:</label>
     <itemset nodeset="list">
            <label ref="@name"/>
            <value ref="@id"/>
     </itemset>
</select1>

<select1 ref="modelName">
     <label>Model:</label>
     <itemset nodeset="list[@id=../manufacturer]/model">
          <label ref="@name"/>
          <value ref="@name"/>
     </itemset>
</select1>

The itemset nodeset dynamically binds to the list selected by the first 
select1.

Cheers,
John M. Boyer, Ph.D.
Senior Product Architect/Research Scientist
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com  http://www.ibm.com/software/






Steve Heron <steven.heron@gmail.com> 
Sent by: www-forms-request@w3.org
10/16/2005 09:17 AM

To
www-forms@w3.org
cc

Subject
reload select when selection changes in linked select







Hi, can anyone tell me how in XForms I would link two select elements
such that when a new selection is made in the first, the contents of
the second are refreshed, eg select a car Manufacturer from list 1 and
see the corresponding car Models in list2 refreshed. What markup would
I need to establish this dependency. The selects must be populated
with value/label pairs, incidentally, a space separated list value
won't do. Thanks in advance.
Steve H
Received on Monday, 17 October 2005 15:29:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:02 GMT