JSF composite component validation -
i want create composite component , attach validators it's children, want message validation attached composite component, not it's child.
in page using composite component want this:
<zzz:mycomponent id="my" /> <h:message for="my" />
now doesn't work, because message component's child, not composite component itself. how make whole component?
or better, add validator composite component, like:
<zzz:mycomponent id="my" validator="#{bean.validatecomposite}" />
and receiver booleans array value, because inside composite component there h:selectbooleancheckbox
elements. possible?
maybe late respond on question how should it:
<zzz:mycomponent id="my"> <f:event type="postvalidate" listener="#{bean.dovalidation}"/> </zzz:mycomponent>
the dovalidation called after validation of childs in 'container'. method llooks this:
public void dovalidation(componentsystemevent event) { ... }
and have 2 options in method:
access child components (event.getcomponent().getchildren() ) , whatever want values submitted on childs.
or loop on facesmessages , reallocate clientid placed on container component (id = my)
Comments
Post a Comment