【问题标题】:Orbeon bug when xf:range initialy hiddenxf:range 初始隐藏时的 Orbeon 错误
【发布时间】:2019-11-21 05:33:17
【问题描述】:

我正在尝试使用 Orbeon 中的 xf:range 控件,因为我正在制作的表单需要一个滑块。 如果在呈现表单时范围控件可见,则这是可能的。 如果该范围最初是隐藏的,然后在满足特定条件后变为可见,则无法正确呈现该范围之后的所有控件。

这是一个已知的错误吗?有没有办法解决这个问题或实施解决方法?

<xh:html xmlns:xh="http://www.w3.org/1999/xhtml"
         xmlns:ev="http://www.w3.org/2001/xml-events"
         xmlns:exf="http://www.exforms.org/exf/1-0"
         xmlns:fb="http://orbeon.org/oxf/xml/form-builder"
         xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
         xmlns:saxon="http://saxon.sf.net/"
         xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
         xmlns:sql="http://orbeon.org/oxf/xml/sql"
         xmlns:xf="http://www.w3.org/2002/xforms"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:xxf="http://orbeon.org/oxf/xml/xforms"
         xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
         fr:data-format-version="4.0.0">
    <xh:head>
        <xh:title/>
        <xf:model id="fr-form-model" xxf:expose-xpath-types="true">
        <!-- Main instance -->
        <xf:instance id="fr-form-instance" xxf:exclude-result-prefixes="#all" xxf:index="id">
            <form>
                <section-1>
                    <min>1</min>
                    <max>10</max>
                    <range>0</range>
                    <range-output/>
                    <value/>
                </section-1>
                <section-2>
                    <min2>1</min2>
                    <max2>10</max2>
                    <visible-value2/>
                    <range2>0</range2>
                    <value2/>
                </section-2>
            </form>
        </xf:instance>

        <!-- Bindings -->
        <xf:bind id="fr-form-binds" ref="instance('fr-form-instance')">
            <xf:bind id="section-1-bind" name="section-1" ref="section-1">
                <xf:bind id="min-bind" name="min" ref="min"/>
                <xf:bind id="range-output-bind" ref="range-output" name="range-output"/>
                <xf:bind id="range-bind" ref="range" name="range" xxf:whitespace="trim"/>
                <xf:bind id="max-bind" ref="max" name="max" xxf:whitespace="trim"/>
                <xf:bind id="value-bind" ref="value" name="value"
                         calculate="round(($max - $min) * $range + $min)"/>
            </xf:bind>
            <xf:bind id="section-2-bind" ref="section-2" name="section-2" relevant="$value &gt; 5">
                <xf:bind id="min2-bind" name="min2" ref="min2"/>
                <xf:bind id="max2-bind" ref="max2" name="max2" xxf:whitespace="trim"/>
                <xf:bind id="range2-bind" ref="range2" name="range2" xxf:whitespace="trim"/>
                <xf:bind id="value2-bind" ref="value2" name="value2"
                         calculate="round(($max2 - $min2) * $range2 + $min2)"/>
                <xf:bind id="visible-value2-bind" ref="visible-value2" name="visible-value2"
                         xxf:whitespace="trim"
                         calculate="round(($max2 - $min2) * $range2 + $min2)"/>
            </xf:bind>
        </xf:bind>

        <!-- Metadata -->
        <xf:instance xxf:readonly="true" id="fr-form-metadata" xxf:exclude-result-prefixes="#all">
            <metadata>
                <application-name>banking</application-name>
                <form-name>test</form-name>
                <title xml:lang="en"/>
                <description xml:lang="en"/>
            </metadata>
        </xf:instance>

        <!-- Attachments -->
        <xf:instance id="fr-form-attachments" xxf:exclude-result-prefixes="#all">
            <attachments>
                <css mediatype="text/css" filename="" size=""/>
                <pdf mediatype="application/pdf" filename="" size=""/>
            </attachments>
        </xf:instance>

        <!-- All form resources -->
        <!-- Don't make readonly by default in case a service modifies the resources -->
        <xf:instance id="fr-form-resources" xxf:readonly="false" xxf:exclude-result-prefixes="#all">
            <resources>
                <resource xml:lang="en">
                    <min2>
                        <label>min</label>
                        <hint/>

                    </min2>
                    <max2>
                        <label>max</label>
                        <hint/>
                    </max2>
                    <visible-value2>
                        <label>visible value</label>
                        <hint/>
                    </visible-value2>
                    <range2>
                        <label/>
                        <hint/>
                    </range2>
                    <value2>
                        <label>not rendered value</label>
                        <hint/>
                    </value2>
                    <section-1>
                        <label>Default Section</label>
                    </section-1>
                    <section-2>
                        <label>Hidden section</label>
                    </section-2>
                    <min>
                        <label>min</label>
                        <hint/>

                    </min>
                    <max>
                        <label>max</label>
                        <hint/>
                    </max>
                    <range>
                        <label/>
                        <hint/>
                    </range>
                    <range-output>
                        <label/>
                        <hint/>
                    </range-output>
                    <value>
                        <label>value</label>
                        <hint/>
                    </value>
                </resource>
            </resources>
        </xf:instance>

        </xf:model>
</xh:head>
<xh:body>
    <fr:view>
        <fr:body xmlns:xbl="http://www.w3.org/ns/xbl" xmlns:p="http://www.orbeon.com/oxf/pipeline"
                 xmlns:oxf="http://www.orbeon.com/oxf/processors">
            <fr:section id="section-1-control" bind="section-1-bind">
                <xf:label ref="$form-resources/section-1/label"/>
                <fr:grid id="grid-1-grid">
                    <fr:c y="1" x="1" w="6">
                            <xf:input id="min-control" bind="min-bind">
                                <xf:label ref="$form-resources/min/label"/>
                                <xf:hint ref="$form-resources/min/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>

                            </xf:input>
                        </fr:c>
                    <fr:c y="1" x="7" w="6">
                        <xf:input id="max-control" bind="max-bind">
                            <xf:label ref="$form-resources/max/label"/>
                            <xf:hint ref="$form-resources/max/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>


                        </xf:input>
                    </fr:c>
                    <fr:c x="1" y="2" w="6">
                        <xf:range id="range-control" bind="range-bind">
                            <xf:label ref="$form-resources/range/label"/>
                            <xf:hint ref="$form-resources/range/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>


                        </xf:range>
                    </fr:c>
                    <fr:c x="7" y="2" w="6">
                        <xf:output id="range-output-control" bind="range-output-bind">
                            <xf:label ref="$form-resources/range-output/label"/>
                            <xf:hint ref="$form-resources/range-output/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>


                        </xf:output>
                    </fr:c>
                    <fr:c x="1" y="3" w="6">
                        <xf:output id="value-control" bind="value-bind">
                            <xf:label ref="$form-resources/value/label"/>
                            <xf:hint ref="$form-resources/value/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>


                        </xf:output>
                    </fr:c>
                    <fr:c x="7" y="3" w="6"/>
                </fr:grid>
            </fr:section>
            <fr:section id="section-2-section" bind="section-2-bind">
                <xf:label ref="$form-resources/section-2/label"/>
                <fr:grid id="grid-2-grid">
                    <fr:c x="1" y="1" w="6">
                        <xf:input id="min2-control" bind="min2-bind">
                                <xf:label ref="$form-resources/min2/label"/>
                                <xf:hint ref="$form-resources/min2/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>


                            </xf:input>
                    </fr:c>
                    <fr:c x="7" y="1" w="6">
                        <xf:input id="max2-control" bind="max2-bind">
                            <xf:label ref="$form-resources/max2/label"/>
                            <xf:hint ref="$form-resources/max2/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>



                        </xf:input>
                    </fr:c>
                    <fr:c x="1" y="2" w="6">
                        <xf:input id="visible-value2-control" bind="visible-value2-bind">
                            <xf:label ref="$form-resources/visible-value2/label"/>
                            <xf:hint ref="$form-resources/visible-value2/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>


                        </xf:input>
                    </fr:c>
                    <fr:c x="7" y="2" w="6"/>
                    <fr:c x="1" y="3" w="6">
                        <xf:range id="range2-control" bind="range2-bind">
                            <xf:label ref="$form-resources/range2/label"/>
                            <xf:hint ref="$form-resources/range2/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>



                        </xf:range>
                    </fr:c>
                    <fr:c x="7" y="3" w="6"/>
                    <fr:c x="1" y="4" w="6">
                        <xf:output id="value2-control" bind="value2-bind">
                            <xf:label ref="$form-resources/value2/label"/>
                            <xf:hint ref="$form-resources/value2/hint"/>
                            <xf:alert ref="$fr-resources/detail/labels/alert"/>



                        </xf:output>
                    </fr:c>
                    <fr:c x="7" y="4" w="6"/>
                </fr:grid>
            </fr:section>
        </fr:body>
    </fr:view>
</xh:body>

【问题讨论】:

  • 我已经在下面发布了您的问题的答案。关于此问题的低优先级,如果您是客户,我建议您联系支持人员,因为这可能会影响优先级;)。

标签: orbeon


【解决方案1】:

确实,这是一个错误,如果你想跟踪这个,你可以关注issue #4131。但是请注意,范围控件当前在表单生成器中不可用,因此只有在编辑表单源并将控件显式更改为xf:range 时才会遇到此问题,所以这很可能在这一点上是一个相当低优先级的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-13
    • 1970-01-01
    • 2020-02-05
    • 1970-01-01
    • 1970-01-01
    • 2015-12-29
    • 1970-01-01
    相关资源
    最近更新 更多