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

How to set dynamically the value of attribute case on element toggle within an itemset

From: Paul Hermans <paul.hermans@amplexor.com>
Date: Thu, 26 Oct 2006 12:34:32 +0200
Message-ID: <DEF32271883F8941B74CE60E7388C5F6228582@diocletian.amplexor.com>
To: <www-forms@w3.org>

Is there a mechanism to dynamically set the attribute case on the toggle element within an itemset.

This is some sample code:

<!-- list to populate a select1 -->
<f:instance id="dimensionlist">
    <dimensions>
       <dimension class="afmeting">
         <name>hoogte</name>
       </dimension>
       <dimension class="afmeting">
         <name>lengte</name>
       </dimension>
       <dimension class="gewicht">
         <name>gewicht</name>
       </dimension>
    </dimensions>
</f:instance>

<!-- list to be subsetted based on a selection in previous one -->
<f:instance id="unitlist">
   <units>
     <unit dimension="afmeting">
        <name>millimeter</name>
        <value>mm</value>
     </unit>
     <unit dimension="afmeting">
        <name>centimeter</name>
        <value>cm</value>
     </unit>
     <unit dimension="afmeting">
        <name>meter</name>
        <value>m</value>
     </unit>
     <unit dimension="gewicht">
        <name>gram</name>
        <value>g</value>
     </unit>
     <unit dimension="gewicht">
        <name>kilogram</name>
        <value>kg</value>
    </unit>
 </units>
</f:instance>

 <f:select1 ref="dimension" appearance="single">
   <f:itemset nodeset="instance('dimensionlist')/dimension">
      <f:label ref="name"/>
      <f:value ref="name"/>
<!-- -------------------------------------------------------------------------- -->
<f:toggle ev:event="xforms-select" case="HOW_TO_SET_DYNAMICALLY"/>

If selected dimension has @class='afmeting', case="afstand"
If selected dimension has @class='gewicht', case="gewicht"

<!-- -------------------------------------------------------------------------- -->
   </f:itemset>
<f:select1>

 <f:switch>
   <f:case id="afstand">
   <f:select1 ref="unit" appearance="single">
     <f:itemset nodeset="instance('unitlist')/unit[@dimension='afmeting']">
       <f:label ref="name"/>
       <f:value ref="value"/>
    </f:itemset>
   </f:select1>
   </f:case>
   <f:case id="gewicht">  
   <f:select1 ref="unit" appearance="single">
     <f:itemset nodeset="instance('unitlist')/unit[@dimension='gewicht']">
       <f:label ref="name"/>
       <f:value ref="value"/>
    </f:itemset>
   </f:select1>
</f:case>
</f:switch>
Received on Thursday, 26 October 2006 16:50:19 GMT

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