I am passing context attributes to a xforms:send action, which works well using the event() function to population the attributes of the submission. However I would like to
access these event attributes in the resulting xforms-submit-done event for the submission. Is this possible? Here’s my setup: <xforms:trigger> <xforms:label>send</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:send submission="submission"> <xxforms:context name="ID" select="string('12345')"/> </xforms:send> </xforms:action> </xforms:trigger> <xforms:submission id="submission" resource="http://localhost/{event('ID')}" method="get" replace="instance" instance="submission_return" > <xforms:action ev:event="xforms-submit-done"> <xforms:message> <xforms:output value="event('ID')"/> </xforms:message> </xforms:action> </xforms:submission> Thanks, David Lacy Falvey Library Technology Services Villanova University library.villanova.edu 610-519-7361 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
I usually handle this slightly differently. On DOMActivate of your trigger, before the xforms:send, you could set the value of an instance, ID. Your resource can point to <a href="http://localhost/{instance('ID')}">http://localhost/{instance('ID')} and then you can output instance('ID') on xforms-submit-done
Ethan On Fri, Jul 20, 2012 at 10:30 AM, David Lacy <[hidden email]> wrote:
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
I was doing that initially but had to rethink my approach after utilizing asynchronous submissions. My action is fired numerous times on page load. By the time
xforms-submit-done fires from the first submission, instance(‘ID’) will have changed. David Lacy Falvey Library Technology Services Villanova University library.villanova.edu 610-519-7361 From: Ethan Gruber [mailto:[hidden email]]
I usually handle this slightly differently. On DOMActivate of your trigger, before the xforms:send, you could set the value of an instance, ID. Your resource can point to
http://localhost/{instance('ID')} and then you can output instance('ID') on xforms-submit-done On Fri, Jul 20, 2012 at 10:30 AM, David Lacy <[hidden email]> wrote: I am passing context attributes to a xforms:send action, which works well using the event() function to population
the attributes of the submission. However I would like to access these event attributes in the resulting xforms-submit-done event for the submission. Is this possible? Here’s my setup: <xforms:trigger> <xforms:label>send</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:send submission="submission"> <xxforms:context name="ID" select="string('12345')"/> </xforms:send> </xforms:action> </xforms:trigger> <xforms:submission id="submission" resource="http://localhost/{event('ID')}" method="get" replace="instance" instance="submission_return" > <xforms:action ev:event="xforms-submit-done"> <xforms:message> <xforms:output value="event('ID')"/> </xforms:message> </xforms:action> </xforms:submission> Thanks, David Lacy Falvey Library Technology Services Villanova University <a href="tel:610-519-7361" target="_blank">610-519-7361
-- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
In reply to this post by David Lacy
David,
No, it's not possible: event context information is only kept around while the event is being processed. Once the submission starts, context information for the xforms-submit event is gone. xforms-submit-done is a completely separate event and will have its own context information. This means that, unfortunately, you must store that state in a place where it can persist between the beginning and end of the submission. -Erik On Fri, Jul 20, 2012 at 7:30 AM, David Lacy <[hidden email]> wrote: > I am passing context attributes to a xforms:send action, which works well > using the event() function to population the attributes of the submission. > However I would like to access these event attributes in the resulting > xforms-submit-done event for the submission. > > > > Is this possible? > > > > Here’s my setup: > > > > <xforms:trigger> > > <xforms:label>send</xforms:label> > > <xforms:action ev:event="DOMActivate"> > > <xforms:send submission="submission"> > > <xxforms:context name="ID" select="string('12345')"/> > > </xforms:send> > > </xforms:action> > > </xforms:trigger> > > > > <xforms:submission id="submission" > > resource="http://localhost/{event('ID')}" > > method="get" > > replace="instance" > > instance="submission_return" > > > > > <xforms:action ev:event="xforms-submit-done"> > > <xforms:message> > > <xforms:output value="event('ID')"/> > > </xforms:message> > > </xforms:action> > > </xforms:submission> > > > > Thanks, > > > > David Lacy > > Falvey Library Technology Services > > Villanova University > > library.villanova.edu > > 610-519-7361 > > > > > > -- > You receive this message as a subscriber of the [hidden email] mailing > list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Thanks for clearing that up.
David Lacy Falvey Library Technology Services Villanova University library.villanova.edu 610-519-7361 > -----Original Message----- > From: [hidden email] [mailto:[hidden email]] On Behalf Of Erik > Bruchez > Sent: Tuesday, July 24, 2012 1:35 AM > To: [hidden email] > Subject: [ops-users] Re: xforms:send xxforms:context attributes > > David, > > No, it's not possible: event context information is only kept around while the event > is being processed. Once the submission starts, context information for the > xforms-submit event is gone. > xforms-submit-done is a completely separate event and will have its own context > information. > > This means that, unfortunately, you must store that state in a place where it can > persist between the beginning and end of the submission. > > -Erik > > On Fri, Jul 20, 2012 at 7:30 AM, David Lacy <[hidden email]> wrote: > > I am passing context attributes to a xforms:send action, which works > > well using the event() function to population the attributes of the submission. > > However I would like to access these event attributes in the resulting > > xforms-submit-done event for the submission. > > > > > > > > Is this possible? > > > > > > > > Here's my setup: > > > > > > > > <xforms:trigger> > > > > <xforms:label>send</xforms:label> > > > > <xforms:action ev:event="DOMActivate"> > > > > <xforms:send submission="submission"> > > > > <xxforms:context name="ID" select="string('12345')"/> > > > > </xforms:send> > > > > </xforms:action> > > > > </xforms:trigger> > > > > > > > > <xforms:submission id="submission" > > > > resource="http://localhost/{event('ID')}" > > > > method="get" > > > > replace="instance" > > > > instance="submission_return" > > > > > > > > > <xforms:action ev:event="xforms-submit-done"> > > > > <xforms:message> > > > > <xforms:output value="event('ID')"/> > > > > </xforms:message> > > > > </xforms:action> > > > > </xforms:submission> > > > > > > > > Thanks, > > > > > > > > David Lacy > > > > Falvey Library Technology Services > > > > Villanova University > > > > library.villanova.edu > > > > 610-519-7361 > > > > > > > > > > > > -- > > You receive this message as a subscriber of the [hidden email] > > mailing list. > > To unsubscribe: mailto:[hidden email] > > For general help: mailto:[hidden email]?subject=help > > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |