一对一互连控件的动态绑定

发布于 2024-11-02 08:06:08 字数 199 浏览 1 评论 0原文

是否可以为依赖于相应重复控件的重复控件提供动态绑定。考虑以下场景。

    Principal1  Rate1
    Principal2  Rate2
    Principal3  Rate3
    Principal4  Rate4

在这种情况下,Rate1 取决于Principal1,例如(Rate1

Is it possible to provide dynamic binding for repeating controls which has dependency on corresponding repeating controls. Consider the following scenario.

    Principal1  Rate1
    Principal2  Rate2
    Principal3  Rate3
    Principal4  Rate4

In this scenario the Rate1 is dependent on Principal1 such as (Rate1 < Principal1 ). Similar conditions stays for Rate2,Rate3,Rate4 as well. Is it possible to impound this constraint using a generalized bind or is it necessary to put binds and constraints for each individual Rate control? Kindly advise..

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

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

发布评论

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

评论(1

如梦 2024-11-09 08:06:08

查看 XPath 相对路径。

您可以为重复区域的相对路径编写约束。我认为Principal1 和Rate1 将一起重复。

<repeated-section>
   <principal>
   <rate>
</repeated-section>

我们对主字段施加了一个约束,规定如果速率(在同一重复内)大于 100,则主字段有效

<xforms:bind nodeset="instance('instance')/repeated-section/principal"     
     constraint="../rate > 100" />

注意: 另外请确保不在重复部分中使用绑定。使用 ref="" 代替并声明输入相对于重复部分的相对路径

Look into XPath relative paths.

You can write the constraint for the repeated areas relative path. I presume Principal1 and Rate1 are going to be repeated together.

<repeated-section>
   <principal>
   <rate>
</repeated-section>

We have a constraint placed on the principal field that states if the rate (within the same repeat) is greater than 100, the principal field is valid

<xforms:bind nodeset="instance('instance')/repeated-section/principal"     
     constraint="../rate > 100" />

Note: Also make sure not to use binds within repeated sections. Use ref="" instead and state the input's relative path in relation to the repeated section

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