Orbeon 从 3.9 升级到 4.5:自定义提交以保存表单 [英] Orbeon upgrade from 3.9 to 4.5 : Customized submit for saving forms
问题描述
我们正在从 3.9 升级到 4.5.
We are upgrading from 3.9 to 4.5.
在一些 3.9 Orbeon 表单中,我们使用自定义提交按钮进行保存.
In Some 3.9 Orbeon forms, We use customized submit button for save.
这不适用于 4.5 Orbeon 形式.当我点击提交"时,它不会将表单保存到 orbeon_form_data
表.
This is not working in 4.5 Orbeon forms. When I click on "Submit", Its not saving the form to orbeon_form_data
table.
以下是提交"的源代码部分,
Below is the source code section for the "submit",
<xhtml:head>
<xforms:bind id="eoisave-btn-bind" ref="eoisave-btn" name="eoisave-btn" type="xforms:string"
relevant="$Bidlist_IsBidding != ''"/>
</xhtml:head>
<xhtml:body>
<fr:button id="eoisave-btn-control" bind="eoisave-btn-bind">
<xforms:label ref="$form-resources/eoisave-btn/label"/>
<xforms:hint ref="$form-resources/eoisave-btn/hint"/>
<xforms:alert ref="$fr-resources/detail/labels/alert"/>
</fr:button>
<xforms:action ev:event="DOMActivate" ev:observer="eoisave-btn-control">
<xforms:setvalue if="xxforms:instance('fr-error-summary-instance')/valid = 'true'"
ref="./EOISaved"
value="1"/>
<xforms:setvalue ref="./user-action">submit eoi</xforms:setvalue>
<xforms:dispatch name="fr-save-action" target="fr-persistence-model">
<xxforms:context name="fr:check-data-valid" select="true()"/>
</xforms:dispatch>
</xforms:action>
</xhtml:body>
在 orbeon 日志中,我可以找到以下内容.
And In the orbeon log, I can find the following.
+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred |
|----------------------------------------------------------------------------------------------------------------------|
|Cannot compare xs:boolean to xs:string |
|----------------------------------------------------------------------------------------------------------------------|
|Application Call Stack |
|----------------------------------------------------------------------------------------------------------------------|
|----------------------------------------------------------------------------------------------------------------------|
|Exception: org.orbeon.saxon.trans.XPathException |
|----------------------------------------------------------------------------------------------------------------------|
推荐答案
Orbeon Forms 4.5 具有可以与按钮关联的简单流程.请参阅Form Runner:按钮和流程.使用它们的好处是您不像使用 3.9 那样依赖 Form Runner 的内部结构.现在我不确定流程是否允许你做你现在想做的一切,比如设置值,但我想我会提到它们.
Orbeon Forms 4.5 has simple processes which you can associate with buttons. See Form Runner: Buttons and Processes. The benefit of using those is that you don't rely on internals of Form Runner as you did with 3.9. Now I am not sure processes allow you to do everything you want to do at the moment, such as setting values, but I thought I would mention them.
这就是说,作为第一步,尝试改变:
This said, as a first step, try changing:
xxforms:instance('fr-error-summary-instance')/valid = 'true'
到:
xxforms:instance('fr-error-summary-instance')/valid = true()
其次,fr-save-action
不见了.这是一个内部 Form Runner 事件.试试:
Second, the fr-save-action
is gone. This was an internal Form Runner event. Try instead:
<xf:action type="xpath" xmlns:process="java:org.orbeon.oxf.fr.process.SimpleProcess">
process:runProcessByName('oxf.fr.detail.process', 'save-final')
</xf:action>
请注意,我尚未对此进行测试.
Note that I haven't tested this.
这篇关于Orbeon 从 3.9 升级到 4.5:自定义提交以保存表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!