I have a situation where the response from a web service (authentication) is being examined before performing another xforms:send. The problem I have is that the xforms-submit-done is being hit for both the form submission and the authentication.
The code is given below:
<xf:action ev:event="xforms-submit-done" ev:observer="Authenticate-submission" context="instance('fr-service-response-instance')">
<xf:action if="contains(//AuthenticateReturn,'true')">
<!-- If correctly Authenticated, then continue with the form submission -->
<xf:send submission="SubmitForm-submission"/>
<xf:action ev:event="xforms-submit" ev:observer="SubmitForm-submission" />
<!-- Response actions -->
<xf:action ev:event="xforms-submit-done" ev:observer="SubmitForm-submission" context="instance('fr-service-response-instance')">
<!-- This section is entered twice, once for the Authenticate-submission andonce for the SubmitForm-submission -->
<xf:message level="modal">Submission complete</xf:message>
</xf:action>
</xf:action>
</xf:action>
How can I amend my code to ensure that the message is ONLY displayed after a sucessful submission to the SubmitForm-submission, and not to the Authenticate-submission?
TIA Peter