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

Re: Context consuming actions

From: David Landwehr <david.landwehr@solidapp.com>
Date: Sat, 1 Apr 2006 09:32:20 +0200
Message-Id: <C03A7D00-4A40-4DF0-975A-C3FCEDE4C224@solidapp.com>
Cc: www-forms@w3.org, w3c-forms@w3.org
To: John Boyer <boyerj@ca.ibm.com>
Hi John,

I believe this problem is related to the one I send to the list a  
while back [1]. In my implementation since the UI's bindings is first  
rewire in the refresh event and your event sequence is running in a  
deferred action scope then the trigger will first have a null context  
after the action block. If you had a xforms:refresh between the  
delete and setvalue then the setvalue would get a null context.

So in my implementation I only update the context for the UI in the  
refresh handling. I execute the XPath expression on actions for every  
execution (I'm unsure if the specification is clear about this). My  
XPath implementation can handle that the trigger's context node is no  
longer in the document and e.g. <setvalue ref=".."/>  evaluate to a  
null node in your example.

I wouldn't use an exception for this scenario at all. I thought that  
a null context for an action would result in a NOP. That is want I do  
since I thought binding-exception was used only when something was  
bad with a IDREF pointing no way or to something wrong. Also the  
point that an exception terminates processing seems a bit to much for  
me since it could be intentional by the author. E.g.
<xforms:setvalue ref="self::node()[conditional expression]"  
value="[value expression]"/>
if the conditional expression make the ref evaluate to the empty node- 
set would the value expression then also dispatch a binding  
exception? I guess it shouldn't and that this scenario is not really  
different from yours.

Best regards,
David

[1] Question about updating UIInline inside of message
http://lists.w3.org/Archives/Public/www-forms-editor/2006Jan/0009.html

Den Mar 31, 2006 kl. 9:38 PM skrev John Boyer:

>
> We have been assuming up to now that if an action consumes the context
> node, then any subsequent action requiring an XPath evaluation should
> fail with an exception.
> We've been using binding exception as the most reasonable exception,
> but because this exact case is not called out in the spec, it seems  
> reasonable
> to ask the community about it...
>
> How are other XForms implementers handling this case?
>
> To be specific, suppose you have an action sequence that
> performs a delete action followed by a setvalue.  However,
> let the delete destroy a node that either is or is an ancestor of
> the context node for the action sequence.
>
> What happens when the setvalue runs?
>
> <trigger ref="/some/node">
>    <label>Don't press me</label>
>    <action ev:event="DOMActivate">
>          <delete nodeset="." at="1"/>
>          <setvalue ref="." value=" 'oops' "/>
>    </action>
> </trigger>
>
> Thanks,
> 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/boyer/index.jsp
>
Received on Saturday, 1 April 2006 07:32:28 GMT

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