2016-05-06 1 views
2

にatrributeは、私のようなネストされた2つの複合要素があります。渡すF:ネストされた組成成分の

<my:inputContainer> 
    <my:input/> 
</my:inputContainer> 

を私はF合格する必要があります。それを得るために、入力:属性は私をすると背中のバリで:

<my:inputContainer> 
    <my:input> 
     <f:attribute name="attr" value="any value"/> 
    </my:input> 
</my:inputConainer> 

しかし、私はcomponent.getAttributesからバリデータの属性値を取得しようとすると、()それは存在しません。すべてのヘルプは理解されるであろう

<cc:implementation> 
    <my:input name="input1"/> 
    <my:input name="input2"> 
     <f:attribute name="input1Value" value="#{cc.attrs.input1Value}"/> 
     <f:validator validatorId="myInputValidator" for="inputText"/>  
    </my:input> 
</cc:implementation> 

私の部品は、基本的には、このように定義されています。

答えて

1

私はそれが不可能であることを認識しました。 cc:insertChildrenf:属性を表示しません。 f:属性をあるコンポーネントから別のコンポーネントに渡す場合は、cc:という属性をcc:interfaceに定義する必要があります。

ComponentA

... 
<cc:implentation> 
    <my:componentB> 
     <f:attribute name="myAttr" value="The attribute value"/> 
    </my:componentB> 
</cc:implementation> 

ComponentB

<cc:interface> 
    ... 
    <cc:attribute name="myAttr"/> 
</cc:attribute> 

<cc:implementation> 
    <my:input name="input1"/> 
    <my:input name="input2"> 
     <f:attribute name="input1Value" value="#{cc.attrs.myAttr}"/> 
     <f:validator validatorId="myInputValidator" for="inputText"/>  
    </my:input> 
</cc:implementation> 
+0

それが仕事です!ありがとう。 –

関連する問題