XForms:如何使用 select1 渲染未选择任何项目的单选组
我正在使用 XBL 在 XForm 上呈现各种控件。其中之一是具有 4 个选项的单选组。我正在使用外观=“完整”和数据本身的项目集。但是,当渲染单选组时,将选择最后一个选项。我需要删除它,以便最初不会选择任何按钮。
我已经绕了一段时间试图让它发挥作用。如果 XForms 专家中的任何一位能够发布一个简短的示例来说明我如何实现这一目标,我将永远感激不已。
提前致谢。
I am using XBL to render various controls on my XForm. One of these is a radio group with 4 options. I am using appearance="full" and an itemset for the data itself. However, when the radio group is rendered, the last option is selected. I need to remove this so that none of the buttons are selected initially.
I've been going round in circles for a while trying to get this to work. If any of you XForms gurus could post a short example of how I can accomplish this I'd be eternally grateful.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是特定于实现的,但一般来说,初始选择的选项取决于初始实例数据。这意味着:如果
xforms:select1
绑定到的实例节点为空,并且 select1 的xforms:itemset
不包含具有空值的项目,不会选择任何选项。如果存在初始实例值,但项集中没有具有相应值的项,则同样如此。我已经用 Orbeon 对此进行了测试,也许其他实现的行为有所不同。无论如何,所描述的行为也在 XForms 中进行了描述1.1 规范(请参阅以“对于关闭/打开选择”开头的段落),因此我希望它是默认行为。
This may be implementation-specific, but in general, the initial selected option depends on the initial instance data. This means: If the instance node the
xforms:select1
is bound to is empty, and thexforms:itemset
of the select1 doesn't contain an item with an empty value, no option will be selected. The same should be true if there's an initial instance value, but no item in the itemset with a corresponding value.I've tested this with Orbeon, maybe other implementations behave else. Anyway, the described behaviour is described also in the XForms 1.1 Specifications (see the paragraphs starting with "For closed / open selections"), so i would expect it to be the default behaviour.