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

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

From: John Boyer <boyerj@ca.ibm.com>
Date: Thu, 26 Oct 2006 10:54:05 -0700
To: "Paul Hermans" <paul.hermans@amplexor.com>
Cc: www-forms@w3.org, www-forms-request@w3.org
Message-ID: <OFD3406052.CF384115-ON88257213.00617037-88257213.00625736@ca.ibm.com>
The proper feature appears in the next working draft of XForms 1.1 (due 
out real soon now).

For existing XForms 1.0 implementations, you need to change to using 
model-based switching based on the relevance of a set of groups.

For each case in your switch, use a group instead.  Put all those groups 
into a single outer group.

For each inner group, express a ref to a node.  Make that node be relevant 
if and only if the proper dimension selection is made. 

Then you will see that as you make your selections, the proper group 
becomes visible.
The outer group may be needed to help with focus management.  When the 
group containing the focus becomes non-relevant and some other group 
becomes relevant, the focus should be transferred from the non-relevant 
group to the outer group to the newly relevant group, which then pushes 
the focus to its first focusable child.

John M. Boyer, Ph.D.
STSM: Workplace Forms Architect and Researcher
Co-Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com  http://www.ibm.com/software/

Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer





"Paul Hermans" <paul.hermans@amplexor.com> 
Sent by: www-forms-request@w3.org
10/26/2006 03:34 AM

To
<www-forms@w3.org>
cc

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







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 17:54:28 GMT

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