Re: XForms - Submission on multiple instances?

Hi Mark and Lee,

To reiterate, Section 11.1, point 5, bullet 2.
The instance replacement of submission is followed immediately by 
*rebuild*, recalculate, revalidate, *refresh*.
These are *not* deferrred update behaviors after some action (submission 
is not an action; send is an action, but all it does is *initiate* a 
submission).
The rebuild, recalculate, revalidate, refresh are mandatory behaviors that 
occur *before* xforms-submit-done is dispatched.

So, if you have calculates that depend on the instance replacement, the 
rebuild and recalculate ensures they are done correctly.  And if you have 
xforms-value-changed event handlers on controls, then the mandatory 
refresh ensures that all of those are done.  All of this happens before 
xforms-submit-done is dispatched, regardless of whether the submission 
itself is synchronous or asynchronous.

Best regards,
John M. Boyer, Ph.D.
STSM: Workplace Forms Architect and Researcher
Co-Chair, W3C Forms 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





"Mark Birbeck" <mark.birbeck@x-port.net> 
Sent by: www-forms-request@w3.org
10/31/2006 02:00 PM
Please respond to
mark.birbeck@x-port.net


To
www-forms@w3.org
cc

Subject
Re: XForms - Submission on multiple instances?







Hi Aaron,

> I think what Lee is saying is that he is doing a submission that will
> replace the first instance.  And that the act of this replacement of the
> first instance will affect instance nodes in a second instance document
> (I assume through recalculate or xforms-value-changed handlers?).  So he
> wants to be sure that all of that is done before he goes ahead and
> submits the second instance document.  So not as simple as just waiting
> for xforms-submit-done, is it?  It might actually work in some
> processors due to the nature of single threading, but it isn't
> guaranteed to work, is it?

Yes...I agree that this is probably what Lee is saying. (Lee? Is this
right?) But I think the second submission should not take place until
the first is complete.

You are right that some processors are asynchronous and some
synchronous (and there is a new flag in XForms 1.1 to allow authors to
make explicit how a particular submission should behave), but you
should only receive "xforms-submit-done" once the submission has fully
completed. Whether that action handler runs in a new thread or not
shouldn't make any difference to the fact that by the time this
handler _is_ run, the instance should have been updated.

Ah...hang on though...I've just had one thought...if there are
calculations involved (bind statements using @calculate) then a
rebuild might be needed. Perhaps that's the problem that Lee is
having--perhaps his second submission *is* correctly taking place
after the first, but because of the way deferred update works, it may
be that his second instance is not being updated with the data from
the returned first instance until both submissions are complete, and
so he never sees it.

Regards,

Mark

-- 
Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
http://www.formsPlayer.com/

Received on Tuesday, 31 October 2006 22:59:36 UTC