如何在Orbeon / XForms中修改绑定资源后刷新控件的绑定?

时间:2012-11-27 03:54:02

标签: orbeon xforms

以下是我的表单的实例模型:

<xforms:model id="fr-form-model">

    <!-- Main instance -->
    <xforms:instance id="fr-form-instance">
        <form>
            <section-1> <age>20</age> <first-name>Tseveen</first-name>
            </section-1>
        </form>
    </xforms:instance>

    <!-- Bindings -->
    <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
        <xforms:bind id="section-1-bind" nodeset="section-1">
            <xforms:bind id="age-bind" name="age" nodeset="age" />
            <xforms:bind id="first-name-bind" nodeset="first-name"
                name="first-name" />
        </xforms:bind>
    </xforms:bind>

    <!-- All form resources -->
    <!-- Don't make readonly by default in case a service modifies the resources -->
    <xforms:instance id="fr-form-resources" xxforms:readonly="false">
        <resources> <resource xml:lang="en"> <section-1>
        <age> <label>Age</label> <hint>Years since borning</hint> <help>Substract birth date from current date</help>
        <alert>Age is required!</alert> </age> <first-name> <label>First
            name</label> <hint>Enter first name</hint> <help>a.k.a given name</help> <alert>First
        name is required!</alert> </first-name> </section-1> </resource> </resources>
    </xforms:instance>

正如您所见,控件绑定到fr-form-resources中的资源。

我的行动如下:

<xforms:setvalue
            ref="xxforms:instance('fr-form-resources')/resources/resource/section-1/age/label"
            value="'Doljin'" />

这个想法是改变控件的标签文本。

如何在修改Orbeon / XForms中的绑定资源后刷新控件绑定,以便可以更新可视标签文本?

1 个答案:

答案 0 :(得分:0)

这应该自动发生,您无需做任何事情。如果在您的情况下没有发生这种情况,可能是因为您没有修改正确的节点,或者控件未绑定到正确的节点。如果您认为您正在更改正确的节点,请提供一个显示问题的最小示例。

相关问题