How to trigger the external validation code when pressing the send button

66 views
Skip to first unread message

javaudvikling

unread,
Nov 4, 2013, 8:03:45 AM11/4/13
to orb...@googlegroups.com
HI,

Can anyone tell me how to bind the submission code below to the Send button
on a published form?
E.g. when I press the Send button it should trigger the submission code..


<xf:submission id="validation-submission"
ref="instance('user-info')"
resource="http://localhost:62203/api/Values/"
method="post" replace="instance"
instance="validation-result">

<xf:delete ev:event="xforms-submit" ref="//@v:*"/>
<xf:action ev:event="xforms-submit-done">

<xf:insert ref="."
origin="instance('validation-result')/v:data/*"/>

<xf:setvalue iterate="//@v:alert" ref="."
value="concat(., ' (save again to revalidate)')"/>

<xf:dispatch name="fr-visit-all"
targetid="error-summary-incremental"/>
<xf:dispatch name="fr-visit-all"
targetid="error-summary"/>

<xf:refresh/>
<xf:dispatch name="fr-update" targetid="error-summary"/>
</xf:action>
</xf:submission>

--
View this message in context: http://discuss.orbeon.com/How-to-trigger-the-external-validation-code-when-pressing-the-send-button-tp4657597.html
Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.com.

Erik Bruchez

unread,
Nov 5, 2013, 2:40:06 PM11/5/13
to orb...@googlegroups.com
With 4.4 we have a good way to do this:

- You can create your own button and process
(https://github.com/orbeon/orbeon-forms/wiki/Form-Runner:-Buttons-and-Processes)
- In that process you can use `xf:send` to send the submission
- You can add your own custom model logic
(https://github.com/orbeon/orbeon-forms/wiki/Form-Runner:-Custom-Model-Logic)
with that submission

With earlier versions it's harder.

-Erik

--
View this message in context: http://discuss.orbeon.com/How-to-trigger-the-external-validation-code-when-pressing-the-send-button-tp4657597p4657621.html
Reply all
Reply to author
Forward
0 new messages