Re: Query on Xforms repeat element

Yes, XForms easily supports your basic requirement.

You're on the right track with listening for DOMActivate and do a setvalue 
action into "takentransition"

I also think that your idea to use repeat index is viable, though I can't 
tell for sure without seeing your code. 

I think the problem you are hitting, and I am only guessing here, is that 
the DOMActivate handler for your setvalue is running after the submit 
control dispatches xforms-submit. Some implementations make a submit by 
internally creating a trigger and setting up a DOMActivate handler that 
does a send.  The problem with this approach is that it does not guarantee 
that their implicit DOMActivate handler runs after DOMActivate handlers 
written explicitly by the form author.

You can most easily test if this is the problem by changing from submit to 
using a trigger.  You can then write a DOMActivate handler that does the 
setvalue followed by a send action to do the submission.

Let us know if that helps you!

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





"Vineeth Varghese" <vineeth.varghese@tavant.com> 
Sent by: www-forms-request@w3.org
08/16/2006 02:45 AM

To
<www-forms@w3.org>
cc

Subject
Query on Xforms repeat element






Hi All,
 
I have a query in XForms 
 
I have a model instance like:-
<taskview>
  <transition>Back</transition>
  <transition>Save</transition>
  <transition>Next</transition>
  <takentransition/>
</taskview>
 
with <xforms:bind id="takentransition" 
nodeset="/taskview/takentransition"/>
 
And I want to render each <transition> element value as buttons and figure 
out which button was clicked. So what I do in the view is:-
<xforms:repeat id="transitions" nodeset="/taskview/transition">
  <xforms:submit submission="transition-action">
    <xforms:label ref="."/>
  </xforms:submit> 
</xforms:repeat>
 
So basically each element of the nodeset ?/taskview/transition? ? Back, 
Save and Next is rendered as button on the UI. Now when a user clicks on a 
button I want to figure out which button was clicked and set the name of 
the button to the model instance element ?/taskview/taskentransition?. 
 
In my server side application once I get the model I want to be able to 
get the model instance element ?/taskview/taskentransition?, something 
like avoiding passing a request parameter but this doesn?t seem to work (I 
haven?t figured it out).
 
I tried listening for a DomActivate event and the set the value based on 
the repeat index but later figured that we can?t use the repeat index.
 
How could we achieve this?. Does the XForms spec support (I am on XForms 
1.0) this because this seems to be a very basic requirement. 
 
TIA,
Vineeth.

Received on Thursday, 17 August 2006 00:38:22 UTC