webtier@glassfish.java.net

Re: [webtier] [jsf2]validator attribute, composite component. Unexpected exception.

From: Joel Weight <digitaljoel_at_gmail.com>
Date: Thu, 20 May 2010 07:58:54 -0600

It looks like it may be similar behavior to when I was trying to pass an
actionListener.
http://forums.java.net/jive/thread.jspa?threadID=77181&tstart=30

<http://forums.java.net/jive/thread.jspa?threadID=77181&tstart=30>Ed Burns
final reply here may be of interest to you
http://forums.java.net/jive/thread.jspa?threadID=79860&tstart=15

<http://forums.java.net/jive/thread.jspa?threadID=79860&tstart=15>I haven't
been back to that code for a while, so I haven't validated his solution for
myself.

Joel

On Thu, May 20, 2010 at 3:52 AM, <webtier_at_javadesktop.org> wrote:

> have composite component
> xhtml
>
> <?xml version='1.0' encoding='UTF-8' ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:h="http://java.sun.com/jsf/html"
> xmlns:composite="http://java.sun.com/jsf/composite">
>
> <composite:interface>
> <composite:attribute name="inputVar"/>
> <composite:attribute name="validator"
> method-signature="void
> f(javax.faces.context.FacesContext, javax.faces.component.UIComponent,
> java.lang.Object)"
> targets="input"/>
> <composite:editableValueHolder name="input"/>
> </composite:interface>
>
>
> <composite:implementation>
> <h:inputText value="#{cc.attrs.inputVar}" id = "input"/>
> <h:message for = "#{cc.clientId}:input"/>
> </composite:implementation>
>
> </html>
>
>
> use next method as validator
> @ManagedBean
> @ApplicationScoped
> public class Checker {
> public void validateF(FacesContext context, UIComponent component,
> Object value) throws ValidatorException{
> throw new ValidatorException(new FacesMessage("i'm invisible"));
> }
> }
>
>
> call component like this
> <cu:inputText inputVar="hello" validator="#{checker.validateF}"/>
>
>
> but validateF generate not "i'm invisible" exception. It generate this:
> /index.xhtml @37,82 validator="#{checker.validateF}": The class
> 'useful.Checker' does not have the property 'validateF'.
>
> after add property validateF to Checker
>
> public String getValidateF(){
> return "";
> }
>
> and get proper exception "i'm invisible".
>
> Is there solution to avoid adding of property?
> [Message sent by forum member 'glich']
>
> http://forums.java.net/jive/thread.jspa?messageID=470646
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>