呈现selectManyCheckbox没有HTML表 [英] Render selectManyCheckbox without HTML table

查看:234
本文介绍了呈现selectManyCheckbox没有HTML表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法从服务器面板中的 h:selectManyCheckbox 标记创建的呈现html中删除表?



我使用twitter bootstrap,我把复选框放在下拉菜单中:

 < ul class = dropdown-menu dropdown-menu-form> 
< li>< label class =checkbox> < input type =checkbox/>
已激活
< / label>< / li>
< li>< label class =checkbox> < input type =checkbox/>
已停用
< / label>< / li>
< / ul>

所以生成的html表破坏了布局...

< h:outputLabel>< h:selectBooleanCheckbox> 里面< ui:repeat> 。这样你就有了标记的自由。你只需要改变模型。 列表< T> 映射< T,Boolean> 以表示检查的值,



一个即用型组件是Tomahawk的 < t:selectManyCheckbox> ,其中包含额外的布局属性值 spread


is there a way to remove the table out of rendered html that is created by the h:selectManyCheckbox tag in server faces?

I am using twitter bootstrap and i placed the checkboxes inside a dropdown menu:

<ul class="dropdown-menu dropdown-menu-form">
    <li><label class="checkbox"> <input type="checkbox" />
            Activated
    </label></li>
    <li><label class="checkbox"> <input type="checkbox" />
            Deactivated
    </label></li>
</ul>

So the generated html table destroys the layout ...

解决方案

You could just render a bunch of <h:outputLabel><h:selectBooleanCheckbox> inside <ui:repeat>. This way you've markup freedom. You'll only need to alter the model from e.g. List<T> to Map<T, Boolean> to represent the checked values and then loop over the map afterwards to collect checked ones.

A ready-to-use component is Tomahawk's <t:selectManyCheckbox> which has an additional layout attribute value of spread.

这篇关于呈现selectManyCheckbox没有HTML表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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