2011-07-18 7 views
0

コンポジットコンポーネントで自分自身のselectManyCheckboxを作成しようとしています。しかし、私自身のselectItemコンポーネントを使用しようとすると、アイテムはレンダリングされません。f:コンポジットコンポーネント内のselectItem

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> 

それがあります!誰でも私はこの問題を解決する方法アイデア?

ありがとうございました!

+0

」1:1をそのような複合コンポーネントでラップする点はありません。ここで正確に何が強化されましたか? – BalusC

+0

もう1つのコードを残しました – Zinnsoldat

答えて

0

属性/値をcomponentType="javax.faces.SelectItrm"の `cc:interface '要素に追加することで解決しました。

<cc:interface componentType="javax.faces.SelectItem"> 
... 
</cc:interface> 
<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> 
+0

このような1:1コンポーネントを持つ利点は何ですか? – Kukeltje

関連する問題