W3C home > Mailing lists > Public > www-forms@w3.org > May 2007

Re: exf:iterate ?

From: David Landwehr <david.landwehr@picoforms.com>
Date: Sun, 20 May 2007 20:28:48 +0200
Message-Id: <E91C1E41-DE45-440B-A409-EDC43F7DEC94@picoforms.com>
Cc: mark.birbeck@x-port.net, "Adrian Baker" <adrian@fastmail.net>, www-forms@w3.org, www-forms-request@w3.org
To: John Boyer <boyerj@ca.ibm.com>
Is the evaluation context really well defined in all scenarios ?

Consider the following form
<xf:model>
   <xf:instance>
     <data xmlns="">
       <name>Some Name</name>
     </data>
   </xf:instance>
</xf:model>

<xf:group ref="/data">
   <xf:trigger ref="name">
     <xf:label>Press to do funny stuff with the context</xf:label>
     <xf:action ev:event="DOMActivate"> <!-- Here we enter deferred  
updates -->
       <xf:action while=". = 'Some Name'">
         <xf:delete nodeset="." at="1"/>
       </xf:action>
     </xf:action>
   </xf:trigger>
</xf:group>

When the trigger is pressed a DOMActivate will invoke the action  
block and update is now deferred. In the next action block we are  
using the while attribute which gets its context from the trigger.  
Now in that action block we remove the node bound to by the trigger  
using a delete. Because the trigger is not rebound before the next  
refresh what happens with the evaluation context for the @while in  
the following evalution? Is it supposed to have an evaluation context  
of an element which isn't in the main document?

Well, as you also write, one can just use while to mimic the iterate  
functionality (if the processor does not implement the exforms  
extension ;) )

/David

On May 20, 2007, at 7:42 PM, John Boyer wrote:

>
> We resolved [1] to remove 1.1 from 1.1, since @while can at least  
> satisfy all iteration requirements (though sometimes iteration is  
> more pithy).
>
> I have added it to Future Features, including a description of some  
> of the issues that spec ready text would have to handle.   The  
> issues are around insertions, value changes and especially  
> deletions that could change the nodeset over which the iteration is  
> occurring.  Put another way, the issue is that someone needs to  
> write the spec to say what the answers will be and then everyone  
> else needs to actually agree.  For example, there are three  
> opinions about what should happen if nodes are deleted from the  
> action sequence (don't do that, the nodes disappear, the nodes  
> still exist as orphans).
>
> In essence, the iteration attribute creates a situation that is  
> found nowhere else in the entire action system.  For every other  
> action, the attributes of the action are a "point solution" in that  
> they apply only to what that action does at a particular moment in  
> time.  The values of the attributes are not needed once the action  
> completes.  This is even true of @while.
>
> Finally, it should also be noted that some of the main use cases  
> for an iteration attribute have also since been addressed by  
> modifications to insert and delete to allow them to operate over a  
> whole nodeset, so the most prevalent use cases for adding the  
> feature have been addressed without adding enough features to  
> create the issues above.
>
> [1] http://lists.w3.org/Archives/Member/w3c-forms/2005OctDec/ 
> att-0134/2005Oct20.html#resolution1
> [2] http://www.w3.org/MarkUp/Forms/wiki/ 
> Create_a_construct_for_actions_that_iterates_over_a_nodeset
>
> John M. Boyer, Ph.D.
> STSM: Lotus Forms Architect and Researcher
> Chair, W3C Forms Working Group
> Workplace, Portal and Collaboration Software
> IBM Victoria Software Lab
> E-Mail: boyerj@ca.ibm.com
>
> Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
>
>
>
>
> "Mark Birbeck" <mark.birbeck@x-port.net>
> Sent by: www-forms-request@w3.org
> 05/11/2007 10:39 PM
> Please respond to
> mark.birbeck@x-port.net
>
>
> To
> "David Landwehr" <david.landwehr@picoforms.com>
> cc
> "Adrian Baker" <adrian@fastmail.net>, www-forms@w3.org
> Subject
> Re: exf:iterate ?
>
>
>
>
>
>
> I agree, David. We have implemented all of your attributes, including
> @iterate. :)
>
> On 11/05/07, David Landwehr <david.landwehr@picoforms.com> wrote:
> >
> > I could not agree more and I found it a little strange that the  
> working
> > group did not adopt all the attributes. As far as I recall there  
> was no
> > particular reason that @iterate was dropped other than that the  
> iterator
> > description did not specify what happens when a node which it is
> > iterating was deleted (however this could happen it other  
> circumstances
> > as well).
> >
> > Best regards,
> > David Landwehr
> >
> > Adrian Baker skrev:
> > > I'm suprised that there's no equivalent of the @exf:iterate  
> attribute
> > > (http://www.exforms.org/conditionals.html#id4484032) in XForms  
> 1.1, to
> > > go with the @while attribute.
> > >
> > > You can achieve the same thing with @while, but it's very  
> cumbersome
> > > because the context node doesn't change, so you need to  
> initialise a
> > > separate counter & manually increment it.
> > >
> > > Adrian
> >
> >
> >
> >
>
>
> -- 
>  Mark Birbeck, formsPlayer
>
>  mark.birbeck@x-port.net | +44 (0) 20 7689 9232
>  http://www.formsPlayer.com | http://internet-apps.blogspot.com
>
>  standards. innovation.
>
>
Received on Sunday, 20 May 2007 18:29:10 GMT

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