带有重复的错误摘要组件

发布于 2024-10-06 04:44:22 字数 2180 浏览 3 评论 0原文

错误摘要控制报告错误的无效字段计数。附上源码。重现步骤。

  1. 当您第一次访问该页面时,您将有两个空字段,并且无效计数为 2。
  2. 将“Apple”添加到第一个文本框
  3. Tab 到第二个输入控件(不要输入任何内容)。
  4. 单击删除按钮。

节点集有一个橙色节点,该节点具有有效值,但错误摘要报告它有一个无效字段。

`

<xhtml:head>
    <xhtml:title>Repeat Groups</xhtml:title>
    <xforms:model>
        <xforms:instance id="instance">
            <fruits>
                <orange></orange>
                <orange></orange>
                <invalid>0</invalid>
            </fruits>
        </xforms:instance>
        <xforms:instance id="origin-instance">
            <orange></orange>
        </xforms:instance>
    <xforms:bind nodeset="orange" required="true()" />
    </xforms:model>
</xhtml:head>
<xhtml:body>

    <xhtml:h2>Errors</xhtml:h2>
    <fr:error-summary observer="accordionSection" errors-count-ref="invalid" />

    <xforms:group>
         <xforms:output value="invalid">
          <xforms:label>Invalid field count: </xforms:label>
         </xforms:output>
    </xforms:group>

    <xforms:group id="accordionSection">
        <xhtml:h2>With labels</xhtml:h2>
        <xforms:repeat nodeset="orange" id="fruit-repeat-1">
                <xforms:input ref=".">
                <xforms:alert>Fruit: </xforms:alert>
                <xforms:label>Fruit: </xforms:label>
        </xforms:input>
        <xhtml:br />
        </xforms:repeat>
    </xforms:group>

    <xhtml:br/>

    <xforms:trigger>
        <xforms:label>Add</xforms:label>
        <xforms:insert ev:event="DOMActivate" nodeset="orange" at="index('fruit-repeat-1')" origin="instance('origin-instance')"/>
    </xforms:trigger>
    <xforms:trigger>
        <xforms:label>Remove</xforms:label>
        <xforms:delete ev:event="DOMActivate" nodeset="orange" at="index('fruit-repeat-1')"/>
    </xforms:trigger>
</xhtml:body>

`

Error summary control is reporting a wrong invalid field count. Attached is the source. Steps to reproduce.

  1. When you first access the page you will have two empty fields and the invalid count is 2.
  2. Add "Apple" to the first text box
  3. Tab into the second input control (do not enter anything).
  4. Click on delete button.

Nodeset has a single Orange node which has a valid value and yet error summary reports that it has one invalid field.

`

<xhtml:head>
    <xhtml:title>Repeat Groups</xhtml:title>
    <xforms:model>
        <xforms:instance id="instance">
            <fruits>
                <orange></orange>
                <orange></orange>
                <invalid>0</invalid>
            </fruits>
        </xforms:instance>
        <xforms:instance id="origin-instance">
            <orange></orange>
        </xforms:instance>
    <xforms:bind nodeset="orange" required="true()" />
    </xforms:model>
</xhtml:head>
<xhtml:body>

    <xhtml:h2>Errors</xhtml:h2>
    <fr:error-summary observer="accordionSection" errors-count-ref="invalid" />

    <xforms:group>
         <xforms:output value="invalid">
          <xforms:label>Invalid field count: </xforms:label>
         </xforms:output>
    </xforms:group>

    <xforms:group id="accordionSection">
        <xhtml:h2>With labels</xhtml:h2>
        <xforms:repeat nodeset="orange" id="fruit-repeat-1">
                <xforms:input ref=".">
                <xforms:alert>Fruit: </xforms:alert>
                <xforms:label>Fruit: </xforms:label>
        </xforms:input>
        <xhtml:br />
        </xforms:repeat>
    </xforms:group>

    <xhtml:br/>

    <xforms:trigger>
        <xforms:label>Add</xforms:label>
        <xforms:insert ev:event="DOMActivate" nodeset="orange" at="index('fruit-repeat-1')" origin="instance('origin-instance')"/>
    </xforms:trigger>
    <xforms:trigger>
        <xforms:label>Remove</xforms:label>
        <xforms:delete ev:event="DOMActivate" nodeset="orange" at="index('fruit-repeat-1')"/>
    </xforms:trigger>
</xhtml:body>

`

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枕头说它不想醒 2024-10-13 04:44:23

您的示例在夜间构建中运行良好,因此这可能是由于自您使用的版本以来已修复的错误所致。您可以尝试每晚构建一次并让我们知道这是否适合您吗?

Your example works fine with a nightly build, so this might be due to a bug that has been fixed since the version you are using. Could you try with a nightly build and let us know if this works for you?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文