呈现selectManyCheckbox没有HTML表 [英] Render selectManyCheckbox without HTML table
问题描述
有没有办法从服务器面板中的 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表破坏了布局...
< 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屋!