Reputation: 21
I would like to submit two different form data instance when i submit the form.
I tried the following it did not work for me.
<xforms:submission id="save-instance-to-client"
ref="instance('form-instance-customer') instance('form-instance-customer-address')"
action="/exist/rest/db/orbeon/data.xml"
method="put"
validate="false"
replace="none">
<xforms:message ev:event="xforms-submit" level="modal">Attempting to save</xforms:message>
<xforms:message ev:event="xforms-submit-error" level="modal">An error occurred while saving!</xforms:message>
</xforms:submission>
Please suggest some way to submit multiple instances.
Upvotes: 1
Views: 838
Reputation: 31753
The way you are using it, the <xforms:submission>
is doing a PUT of an XML document. If you were to send 2 XML documents, you wouldn't be sending XML anymore, as XML requires one root node. So you have a couple of alternatives:
ref="xxforms:element('root', (instance('form-instance-customer'), instance('form-instance-customer-address')))"
. You specify the name of the root element in the first attribute of the xxforms:element() function. In this case, it will create an element <root>
.Upvotes: 1