如何使用 xforms:submission 标签提交多个表单数据实例
我想在提交表单时提交两个不同的表单数据实例。
我尝试了以下方法,但它对我不起作用。
<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>
请建议一些提交多个实例的方法。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
按照您使用它的方式,
正在执行 XML 文档的 PUT。如果您要发送 2 个 XML 文档,您将不再发送 XML,因为 XML 需要一个根节点。因此,您有几种选择:ref="xxforms:element('root', (instance('form-instance-customer'), instance('form-instance-customer-address' )))”
。您可以在 xxforms:element() 函数。在本例中,它将创建一个元素
。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>
.