RE: Switch inside a repeat in XForms 1.1 [was switch & repeat controls]

Erik,

Switch state is completely independent of the model, and should be seen as
comparable to the scroll position of a text area or the open/close state of
a drop-box.

If an author wants more than this--i.e., to preserve the state across
various interactions with the form, or to associate a state with a
node--then they need to place the information in an instance and use
model-based switching.

So I would say, that if a node is duplicated, for example, the switch state
is *not* duplicated, since it is completely unrelated to the node itself.
(It is in the UI, not the model.)

Regards,

Mark


Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
b: http://internet-apps.blogspot.com/
w: http://www.formsPlayer.com/

Download our XForms processor from
http://www.formsPlayer.com/
 

> -----Original Message-----
> From: www-forms-request@w3.org 
> [mailto:www-forms-request@w3.org] On Behalf Of Erik Bruchez
> Sent: 02 June 2006 15:57
> To: www-forms@w3.org
> Cc: www-forms@w3.org
> Subject: Re: Switch inside a repeat in XForms 1.1 [was switch 
> & repeat controls]
> 
> 
> I don't have a final opinion on this formulation yet (however 
> John there is a typo, "rum-time"), but in addition to 
> specifying that the switches have an independent life and how 
> they react to toggle, I think it is important to also clearly 
> specify the following (I am writing quickly so not 
> elaborating much, but I hope I make some sense
> ;-):
> 
> 1. What happens upon deletion, insertion or cloning of nodes in a
>     node-set addressed by an xforms:repeat with regard to the enclosed
>     switches?
> 
>     I would expect the state of the switches to somehow stay 
> associated
>     with the nodes the enclosing repeats are bound to, so that
>     visually, if a user deletes a row in a table, then the switches
>     update correctly.
> 
>     Same thing upon insertion, and here I see two case:
> 
>     o The insertion duplicates a node that does not have a repeat
>       iteration with switch associated with it (e.g. by using
>       xforms:insert/@origin. In this case, I expect the state of the
>       new switch to be the default state.
> 
>     o The insertion duplicates one of the nodes that current has a
>       repeat iteration associated with it and an associated switch
>       (typical way xforms:insert works by cloning the last element of
>       the node-set). In this case, I would expect the state of the
>       switch to be the same as that of the switch associated with the
>       origin node.
> 
>     Note that this is what we implement in OPS right now.
> 
> 2. What happens in a similar situation upon instance replacement?
> 
>     Here we have two solutions: either restore the switches to their
>     default state, or try to keep their current state. The latter may
>     be difficult to figure out, especially since the structure of the
>     instance may change completely upon replacement.
> 
> -Erik
> 
> John Boyer wrote:
>  >
>  > Hi Nick,
>  >
>  > Please see the latest public XForms 1.1 working draft, 
> Section 5.5  > (http://www.w3.org/TR/xforms11/#SwitchInRepeat)
>  >
>  > Issuance of text around switch in repeat as an erratum is 
> not official  > until it is done, resolved and published, but 
>  > at last check, the consensus of the WG did appear to 
> support the action,  > which is on my list right now.
>  > In the meantime, I did put the content of the above 
> section in place for  > the latest working draft of 1.1, 
> since that is  > the general form of the technical content we 
> decided upon, and it will  > at the very least be a feature 
> of XForms 1.1.
>  >
>  > Cheers,
>  > John M. Boyer, Ph.D.
>  > Senior Product Architect/Research Scientist  > Co-Chair, 
> W3C XForms 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
>  >
>  >
>  >
>  >
>  > *Nick_Van_den_Bleeken@inventivedesigners.com*
>  > Sent by: www-forms-request@w3.org
>  >
>  > 06/01/2006 01:04 AM
>  >
>  > 	
>  > To
>  > 	www-forms@w3.org
>  > cc
>  > 	nicolas.duroc@gmail.com
>  > Subject
>  > 	Switch inside a repeat in XForms 1.1 [was switch & 
> repeat controls]
>  >
>  >
>  > 	
>  >
>  >
>  >
>  >
>  >
>  >
>  > All,
>  >
>  > Did we already decided if we are going to 'solve' the 
> switch inside a  > repeat in XForms 1.1? I'm sure we talked 
> about it, but can't remember what  > the outcome of the 
> discussion was....
>  >
>  > Thanks in advance,
>  >
>  > Nick Van den Bleeken  -  Research & Development  > 
> Inventive Designers  > Phone: +32 - 3 - 8210170  > Fax: +32 - 
> 3 - 8210171  > Email: Nick_Van_den_Bleeken@inventivedesigners.com
>  > ----- Forwarded by Nick Van den Bleeken/Inventive 
> Designers on 06/01/2006  > 10:01 AM -----  >  > "Nicolas 
> Duroc" <nicolas.duroc@gmail.com> wrote on 06/01/2006
> 09:49:09 AM:
>  >
>  >  > All right, I'll wait the next revision of XForms so, 
> hoping that  >  > point will be resolved.
>  >  >
>  >  > Thanks
>  >  >
>  >  > Regards,
>  >  >
>  >  > Nicolas Duroc
>  >  >
>  >  > 2006/6/1, Nick_Van_den_Bleeken@inventivedesigners.com < 
>  >  > Nick_Van_den_Bleeken@inventivedesigners.com >:
>  >  > Hi Nicolas,
>  >  >
>  >  > I don't think switch in a repeat is supported in XForms 
> 1.0 if you read  >  > 
> http://www.w3.org/TR/2003/REC-xforms-20031014/slice9.html#ui-repeat-ui
>  >  >
>  >  > You can see that it states that '... A necessary 
> consequence of this is  >  > that XForms 1.0 does not specify 
> the behavior of construct switch within  >  >  > element repeat.  ...'
>  >  >
>  >  > Regards,
>  >  >
>  >  > Nick Van den Bleeken  -  Research & Development  >  > 
> Inventive Designers  >  > Phone: +32 - 3 - 8210170  >  > Fax: 
> +32 - 3 - 8210171  >  > Email: 
> Nick_Van_den_Bleeken@inventivedesigners.com
>  >  >
>  >  > www-forms-request@w3.org wrote on 05/31/2006 12:21:17 PM:
>  >  >
>  >  > >
>  >  > > Hi,
>  >  > >
>  >  > > I have a repeat controls who lists data from a xml 
> file. Nodes which  > are  >  >  >  > > browsed by the repeat 
> control contains another node, and I would like  > to  >  > 
> make  >  > > a switch to hide/show this node (which contains 
> itself other data).
>  >  > > I tried to
>  >  > > do with switch and case control, but all the "id" 
> case should be  >  > different,  >  > > with an index by 
> exemple (maybe the repeat index ?), i didn't found  > any  >  
> > > examples for this problem, is there a solution ?
>  >  > >
>  >  > > structure of my xml file :
>  >  > > <myFile>
>  >  > >   <row>
>  >  > >     <a>data1</a>
>  >  > >     <node>
>  >  > >        <b>datanode1</b>
>  >  > >     </node>
>  >  > >   </row>
>  >  > >   <row>
>  >  > >     <a>data2</a>
>  >  > >     <node>
>  >  > >        <b>datanode2</b>
>  >  > >     </node>
>  >  > >   </row>
>  >  > >   <row>
>  >  > >     <a>data3</a>
>  >  > >     <node>
>  >  > >        <b>datanode3</b>
>  >  > >     </node>
>  >  > >   </row>
>  >  > > </myFile>
>  >  > >
>  >  > > my repeat control browses the row nodes, displays the 
> "a" data with  >  > input  >  > > control, and i would like 
> to display a "hide/show" control for the  >  > > "node" node.
>  >  > >
>  >  > > <xforms:group appearance="minimal">
>  >  > >    <xforms:repeat nodeset="myFile/row" id="repeatrow"
>  >  > > appearance="compact">
>  >  > >       <xforms:input ref="a">
>  >  > >          <xforms:label>a</xforms:label>
>  >  > >       </xforms:input>
>  >  > >       <xforms:switch id="switch1">
>  >  > >          <xforms:case id="show" selected="false">
>  >  > >             <xforms:trigger id="hide-button">
>  >  > >                <xforms:label>Node</xforms:label>
>  >  > >                <xforms:action>
>  >  > >                   <xforms:toggle case="hide"/>
>  >  > >                </xforms:action>
>  >  > >             </xforms:trigger>
>  >  > >             <input ref="node/b">
>  >  > >                <xforms:label>B</xforms:label>
>  >  > >             </input>
>  >  > >          </xforms:case>
>  >  > >          <xforms:case id="hide" selected="true">
>  >  > >             <xforms:trigger id="show-button">
>  >  > >                <xforms:label>Node</xforms:label>
>  >  > >                <xforms:action>
>  >  > >                   <xforms:toggle case="show"/>
>  >  > >                </xforms:action>
>  >  > >             </xforms:trigger>
>  >  > >          </xforms:case>
>  >  > >       </xforms:switch>
>  >  > >    </xforms:repeat>
>  >  > > </xforms:group>
>  >  > >
>  >  > >
>  >  > >
>  >  >
>  >  >
>  >  >
>  >  > --------------------------------------------------
>  >  >
>  >  > Inventive Designers' Email Disclaimer:
>  >  >
>  >  > http://www.inventivedesigners.com/email-disclaimer
>  >
>  >
>  >
>  > --------------------------------------------------
>  >
>  > Inventive Designers' Email Disclaimer:
>  >
>  > http://www.inventivedesigners.com/email-disclaimer
> 
> --
> Orbeon - XForms Everywhere:
> http://www.orbeon.com/blog/
> 
> 

Received on Friday, 2 June 2006 15:33:35 UTC