Orbeon从3.9升级到4.5:自定义提交保存表单



我们正在从3.9升级到4.5。

在一些3.9 Orbeon表单中,我们使用自定义的提交按钮来保存。

这在4.5 Orbeon表单中不起作用。当我点击"提交"时,它没有将表单保存到orbeon_form_data表。

下面是"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日志中,我可以找到以下内容。

+----------------------------------------------------------------------------------------------------------------------+
|An Error has Occurred                                                                                                 |
|----------------------------------------------------------------------------------------------------------------------|
|Cannot compare xs:boolean to xs:string                                                                                |
|----------------------------------------------------------------------------------------------------------------------|
|Application Call Stack                                                                                                |
|----------------------------------------------------------------------------------------------------------------------|
|----------------------------------------------------------------------------------------------------------------------|
|Exception: org.orbeon.saxon.trans.XPathException                                                                      |
|----------------------------------------------------------------------------------------------------------------------|

Orbeon Forms 4.5具有简单的过程,您可以将其与按钮关联。参见表单运行器:按钮和进程。使用这些的好处是,您不必像使用3.9时那样依赖于Form Runner的内部。现在我不确定进程是否允许你做任何你想做的事情,比如设置值,但我想我应该提到它们。

这就是说,作为第一步,试着改变:

xxforms:instance('fr-error-summary-instance')/valid = 'true'

:

xxforms:instance('fr-error-summary-instance')/valid = true()

第二,fr-save-action消失。这是一个内部Form Runner事件。试试相反:

<xf:action type="xpath" xmlns:process="java:org.orbeon.oxf.fr.process.SimpleProcess">
    process:runProcessByName('oxf.fr.detail.process', 'save-final')
</xf:action>

相关内容

  • 没有找到相关文章

最新更新