开发者

use validateRequired through composite component

I'm trying to forward "f:validateRequired" validator through a composite component without using required attribute.

How to get its value inside of my component ?

<aa:myComponent id="specificNotice" value="#{edit.specificNotice}">
        <f:validateRequired for="specificNotice" disabled="#{empty param['form:save']}"开发者_如何学C />
    </aa:myComponent>

Thanks.


The for attribute should refer the id of the input component inside the composite component implementation. The input component in turn should be declared as <cc:editableValueHolder> inside the composite component interface.

So,

<my:input value="#{bean.input}">
    <f:validateRequired for="input" />
</my:input>

with

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

should do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜