单选按钮在页面的不同部分 [英] Radio buttons in different parts of the page
问题描述
根据我必须满足的布局规范,我需要在页面的不同部分放置带有ICEFaces的单选按钮控件。
I need to place radio button controls with ICEFaces in different parts of my page, according to a layout specification I must meet.
SelectOneRadio
控件允许我在同一个容器中实例化几个单选按钮 ,但是我需要在某些表格单元格中放置两个单选按钮,然后我需要激活一些控件或者不根据选择单选按钮。
SelectOneRadio
control allows me to instantiate several radio buttons in the same container, but I need to place just two radio buttons inside certain table cells, and I then need some controls to be activated or not according to which radio button is selected.
使用纯HTML,我显然需要放置两个< input
s我需要的地方并给它们相同的名称。
With plain HTML, I obviously need to place the two <input
s wherever I need and give them the same name.
如何使用ICEFaces实现相同的功能,以便根据特定的选择启用/禁用控件收音机选项?
How can I achieve the same using ICEFaces so I can enable/disable controls according to the selection of a specific radio option?
谢谢。
推荐答案
我没有完全没有了解IceFaces提供的内容,但Tomahawk有一个 < T:塞莱ctOneRadio>
控件支持额外的布局
属性,其值为 spread
允许您使用 <将标记中的各个单选按钮放置在标记中code>< t:radio> 。
I have no utter idea what IceFaces provides, but Tomahawk has a <t:selectOneRadio>
control which supports an extra layout
attribute with value of spread
which allows you to place the individual radio buttons everywhere you want in the markup using <t:radio>
.
例如
<t:selectOneRadio id="foo" value="#{bean.foo}" layout="spread">
<f:selectItems value="#{bean.foos}" />
</t:selectOneRadio>
...
<t:radio for="foo" index="0" />
...
<t:radio for="foo" index="1" />
...
<t:radio for="foo" index="2" />
...
更新,事实证明,IceFaces克隆了这个Tomahawk发明的功能自1.7版以来。所以在上面的例子中用 t:
替换 ice:
,它就会很好。
Update as turns out, IceFaces has cloned this Tomahawk-invented feature since version 1.7. So just substitute t:
with ice:
in above example and it'll work as good.
这篇关于单选按钮在页面的不同部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!