SourceForge has been redesigned. Learn more.
Close

#33 setvalue inside the xforms-submit-done handler of a submis

open
nobody
None
5
2012-12-21
2010-06-21
No

https://sourceforge.net/mailarchive/forum.php?thread_name=4BF02311.9050300%40Xerox.com&forum_name=xsltforms-support

In xsltforms r403 and earlier versions, setvalue inside the
xforms-submit-done handler of a submission caused by
ev:event="xforms-value-changed" fails to get values of the
submission/@instance target instance data. Instead, it gets data prior
to the replace="instance".

However, when this same submission is triggered by a <submit> control,
it works fine.

<submission id="update-requestor" method="get" resource="lookup.xml"
ref="instance('main')/requestor" replace="instance" instance="names" >
<message ev:event="xforms-submit-error" level="modal">OOPS</message>
<action ev:event="xforms-submit-done">
<setvalue ref="instance('main')/requestor/name"
value="instance('names')/name" />
</action>
</submission>

This effect is most obvious if the result of the submission resource
varies with the input, becuase you can see it's the previous set of values.

In the example posted at
http://xformstest.org/klotz/2010/05/submit/test.xml the lookup.xml is a
static file, so it returns static data, and so the effect is that the
first time, you get nothing, and the second time, you see the setvalue
results from the previous time.

Discussion