带有重复的错误摘要组件
错误摘要控制报告错误的无效字段计数。附上源码。重现步骤。
- 当您第一次访问该页面时,您将有两个空字段,并且无效计数为 2。
- 将“Apple”添加到第一个文本框
- Tab 到第二个输入控件(不要输入任何内容)。
- 单击删除按钮。
节点集有一个橙色节点,该节点具有有效值,但错误摘要报告它有一个无效字段。
`
<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.
- When you first access the page you will have two empty fields and the invalid count is 2.
- Add "Apple" to the first text box
- Tab into the second input control (do not enter anything).
- 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的示例在夜间构建中运行良好,因此这可能是由于自您使用的版本以来已修复的错误所致。您可以尝试每晚构建一次并让我们知道这是否适合您吗?
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?