I'm trying to
get a javascript function to be able to trigger a submission to occur.
From my reading of the documentation at
http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-javascript-events
my understanding is that I ought to be able to use
ORBEON.xforms.Document.dispatchEvent('<the id of the
submission>','xforms-submit') but that doesn't seem to work for me.
I can add a trigger which sends the submission, and then use javascript
to send a DOMActivate event to the trigger, but I can't send an
xforms-submit directly to the submission.
One thing I considered was that perhaps xforms-submit counts as an "external event" as mentioned in the warning in the documentation. However, I wasn't able to fix things by adding the attribute xxforms:external-events="xforms-submit" to the model. I've attached a simple version in which the first javascript link does not fire a submission whereas the second link does send a DOMActivate to the button which in turn fires a submission. --
-- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws javascript-submit.xhtml (1K) Download Attachment |
Administrator
|
Dave,
> I'm trying to get a javascript function to be able to trigger a > submission to occur. From my reading of the documentation at > http://www.orbeon.com/ops/doc/reference-xforms-ng#xforms-javascript-events > my understanding is that I ought to be able to use > ORBEON.xforms.Document.dispatchEvent('<the id of the > submission>','xforms-submit') but that doesn't seem to work for me. I > can add a trigger which sends the submission, and then use javascript to > send a DOMActivate event to the trigger, but I can't send an > xforms-submit directly to the submission. > > One thing I considered was that perhaps xforms-submit counts as an > "external event" as mentioned in the warning in the documentation. > However, I wasn't able to fix things by adding the attribute > xxforms:external-events="xforms-submit" to the model. > > I've attached a simple version in which the first javascript link does > not fire a submission whereas the second link does send a DOMActivate to > the button which in turn fires a submission. For security reasons, you can't dispatch built-in events (i.e. DOM events or XForms events, except DOMActivate, DOMFocusIn and DOMFocusOut) from JavaScript, even if you use xxforms:external-events. I realized that this was not explicit in the doc so I updated it. If you use a custom event instead, then things work. See attached. -Erik -- Orbeon - XForms Everywhere: http://www.orbeon.com/blog/ -- 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 ObjectWeb mailing lists service home page: http://www.objectweb.org/wws javascript-submit.xhtml (2K) Download Attachment |
Free forum by Nabble | Edit this page |