Radio buttons in different parts of the page

做~自己de王妃 提交于 2019-12-20 03:19:49

问题


I need to place radio button controls with ICEFaces in different parts of my page, according to a layout specification I must meet.

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.

With plain HTML, I obviously need to place the two <inputs wherever I need and give them the same name.

How can I achieve the same using ICEFaces so I can enable/disable controls according to the selection of a specific radio option?

Thank you.


回答1:


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>.

E.g.

<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" />
...

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.



来源:https://stackoverflow.com/questions/5218019/radio-buttons-in-different-parts-of-the-page

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!