JSF:更可定制的selectManyCheckbox和selectOneRadio [英] JSF: More customizable selectManyCheckbox and selectOneRadio

查看:77
本文介绍了JSF:更可定制的selectManyCheckbox和selectOneRadio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用selectManyCheckboxes和selectOneRadios,我想以某种方式对其进行自定义.如果有可能根据某个属性(例如,每个组的标题或每个组之间的一行)将selectItem分组,就足够了.

I'm using selectManyCheckboxes and selectOneRadios and I would like to customize them in some way. It would be sufficient if there was be a possibilty to group the selectItems according to a certain property (e. g. with a headline for each group or a line between each group).

使用标准的JSF 2 +战斧可以实现这一目标吗?

Is there any way to achieve this with standard JSF 2 + Tomahawk?

推荐答案

是的,当然可以.您已经选择战斧"了.它是提供组件的极少数组件库之一,这些组件使您可以将复选框和单选按钮以所需的方式放置在任何地方,而不必像标准组件那样将其最终放置在表中.

Yes, certainly this is possible. You've already made a good choice with Tomahawk. It's namely one of the very few component libraries which provides components which allows you to position checkboxes and radiobuttons everywhere the way you want instead of ending up with them in a table as the standard components do.

这是一个带有 <t:selectOneRadio> 的示例新的layout="spread"属性,JSF的默认值为pageDirectionlineDirection)和

Here's a kickoff example with <t:selectOneRadio> (note the new layout="spread" attribute, the JSF defaults are pageDirection and lineDirection) and <t:radio>.

<t:selectOneRadio id="foo" value="#{bean.selectedItem}" layout="spread">
    <f:selectItems value="#{bean.selectItems}" />
</t:selectOneRadio>

<p><t:radio for="foo" index="0" /> radio in paragraph</p>
<h1><t:radio for="foo" index="1" /> radio in heading</h1>
<hr />
<p><t:radio for="foo" index="2" /> radio after horizontal rule</p>

<t:selectManyCheckbox> 还支持layout="spread" <t:checkbox> 相同的方式.

The <t:selectManyCheckbox> also supports layout="spread" with <t:checkbox> the same way.

这允许在这些按钮/复选框及其周围进行更精细的HTML/CSS标记.

This allows for more fine grained HTML/CSS markup on and around those buttons/checkboxes.

这篇关于JSF:更可定制的selectManyCheckbox和selectOneRadio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆