xforms - 与 OR 条件相关
(我刚刚开始使用 xforms)
我有一个带有 10 个整数输入字段和 1 个文本字段的表单 我正在尝试在文本字段上设置相关标准。 我想要做的是当且仅当一个或多个字段的值高于 18 时才显示文本字段。
我相信我需要在相关字段中使用 or 条件,例如: related="(/data/weight_group/weight1 > 18 || /data/weight_group/weight2 > 18)"
显然这并不完全正确,但我在 Google/Stack/等上找不到任何接近的东西,导致我相信我找错了树。
有什么建议吗? 谢谢
(I'm just starting out with xforms)
I have a form with 10 integer entry fields and 1 text field
I'm trying to set a relevant criteria on a text field.
What I want to do is display the text field if and only if the value of one or more of the fields is higher than 18.
I believe I need an or condition in the relevant field, something like:
relevant="(/data/weight_group/weight1 > 18 || /data/weight_group/weight2 > 18)"
Obviously that's not exactly right, but I can't find anything even close on Google/Stack/etc., leading me to believe that I'm barking up the wrong tree.
Any suggestions?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
应该是这样的:
一些解释:
It should be something like this:
Some explanations:
首先,相关属性是模型属性,这意味着它不适用于控件。其次,它通过绑定元素进行更新。
valid_weight 属性受此条件控制,任何绑定到有效权重的控件在不相关时都会消失。
Firstly the relevant property is a model property, that means it does not work on the controls. Secondly it is updated via a bind element.
To the property valid_weight is controlled by this condition, and any control bound to valid weight will disappear when not relevant.