1

ネストされた複合コンポーネントと、ネストされたコンポーネントの入力テキストへのバリデーターの受け渡しに関して、次の問題があります。

ラッパーカスタムコンポーネント(wrapper.xhtml):

<cc:interface>
    <cc:attribute name="value" required="false" />
</cc:interface>

<cc:implementation>
    <h:panelGroup>
        <h:outputLabel value="TEST:"/>
        <temptest:input value="#{cc.attrs.value}">
            <cc:insertChildren/>
        </temptest:input>
    </h:panelGroup>
</cc:implementation>

ネストされたカスタムコンポーネント(input.xhtml):

<cc:interface>
    <cc:attribute name="value" required="false" />
    <cc:editableValueHolder name="input" targets="input" />
</cc:interface>

<cc:implementation>
    <h:inputText value="#{cc.attrs.value}" id="input" >
        <cc:insertChildren/>
    </h:inputText>
</cc:implementation>

ネストされたカスタムコンポーネント(pageXYZ.xhtml)にバリデーターを渡す試行:

<h:form>
...
    <temptest:wrapper value="#{bean.value}">
        <f:validateRequired for="input"/>
    </temptest:wrapper>
    <!-- this works:
    <temptest:input value="#{bean.value}"> 
        <f:validateRequired for="input"/>
    </temptest:input> -->
    <h:message for="input"/>
...
</h:form>

(1つ以上の)バリデーターをネストされたカスタムコンポーネントに渡す方法はありますか?

4

0 に答える 0