开发者

Validator for composite component validates, but also throws exception

开发者 https://www.devze.com 2023-01-28 04:38 出处:网络
I want to attach validator to composite component, and I want it to be attached to every child component inside:

I want to attach validator to composite component, and I want it to be attached to every child component inside:

<cc:interface>
  <cc:attribute name="validator"
                method-signature="void f(javax.faces.context.FacesContext,
                                         javax.faces.component.UIComponent,
                                         java.lang.Object)"
                targets="child1 child2"/>
  <cc:editableValueHolder name="child1"/>
  <cc:editableValueHolder name="child2"/>
</cc:interface>
<cc:implementation>
  <h:inputText id="child1"/>
  <h:inputText id="child2"/>
</cc:implementation>

So on page I have:

<xxx:mycomponent validator="#{bean.validationMethod}"/>

Validation works as expected, but JSF also throws a message: ..../form.xhtml validator="#{bean.validationMethod}": The class 'my.package.Bean' does not have the property 'validationMethod'.

Ho开发者_运维百科w can I get rid of this message?

0

精彩评论

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

关注公众号