我正在尝试使用复合组件创建自己的 selectManyCheckbox。但是当我尝试使用我自己的 selectItem 组件时,这些项目将不会被呈现。
选择项.xhtml:
<cc:implementation>
<f:selectItem rendered="true" id="#{cc.attrs.id}"
itemDescription="#{cc.attrs.itemDescription}"
itemDisabled="#{cc.attrs.itemDisabled}"
itemLabel="#{cc.attrs.itemLabel}" itemValue="#{cc.attrs.itemValue}"
value="#{cc.attrs.value}">
</f:selectItem>
</cc:implementation>
selectManyCheckbox.xhtml:
<!--Some other stuff like label -->
<h:selectManyCheckbox styleClass="#{cc.attrs.styleClass}"
id="#{cc.attrs.id}_checkbox" value="#{cc.attrs.value}"
layout="pageDirection">
<cc:insertChildren />
</h:selectManyCheckbox>
当我使用
<mycomps:selectManyCheckbox id="abc" labelString="Example">
<mycomps:selectItem itemValue="1" itemLabel="One" />
</mycomps:selectManyCheckbox>
它不起作用。但是当我使用
<mycomps:selectManyCheckbox id="abc" labelString="Example">
<f:selectItem itemValue="1" itemLabel="One" />
</mycomps:selectManyCheckbox>
确实如此!有人知道我该如何解决这个问题吗?
谢谢!