webtier@glassfish.java.net

Re: [webtier] Question about Jim Driscoll's Ajax EditText Component Example

From: Lincoln Baxter, III <lincolnbaxter_at_gmail.com>
Date: Mon, 09 Feb 2009 01:00:25 -0500

I still get the NPE without the actionSource. I'll try to see if I can
step debug more thoroughly. Last time it wouldn't let me step in to the
execute() method.


Caused by: java.lang.NullPointerException
        at java.io.Writer.write(Writer.java:140)
        at
com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:193)
        at
com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:120)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:116)
        at
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)



On Sun, 2009-02-08 at 10:06 -0800, Jim Driscoll wrote:

> Well, I don't think we have a test that combines composite:actionSource
> with composite:attribute method-signature, so you may have found a new
> bug. If you remove the actionSource def, does it still fail?
>
> Jim
>
> On 2/8/09 9:30 AM, Lincoln Baxter, III wrote:
> > Good call.
> >
> > My first thought is that I should probably get a more descriptive
> > exception, even if I'm using it wrong.
> > However, I get the same result :( This is what I did... irrelevant parts
> > excluded.
> >
> > *Bean:*
> >
> > public void nameListener(final ActionEvent event)
> > {
> > System.out.println("Listened");
> > }
> >
> >
> > *Consumer:*
> >
> > <a:editText value="#{viewProjectBean.projectGoals}"
> > submitListener="#{viewProjectBean.nameListener}" />
> >
> > *Component:*
> >
> > <composite:interface name="editText"
> > displayName="Editable Text Component"
> > shortDescription="Editable Text Component">
> > <composite:attribute name="submitListener" targets="submit"
> > required="true"
> > method-signature="void f1(javax.faces.event.ActionEvent)" />
> > <composite:attribute name="value" required="true" type="String" />
> > <composite:actionSource name="submit" />
> > </composite:interface>
> >
> > <composite:implementation>
> > .....
> > <h:commandButton value="Submit" id="submit"
> > actionListener="#{compositeComponent.attrs.submitListener}"
> > onclick="return submitButton('#{compositeComponent.clientId}',
> > event);">
> > </h:commandButton>
> > <h:commandButton value="Cancel" id="cancel" styleClass="faded"
> > onclick="return cancelButton('#{compositeComponent.clientId}');" />
> > ....
> > </composite:implementation>
> >
> > </html>
> >
> >
> >
> > On Sun, 2009-02-08 at 08:56 -0800, Jim Driscoll wrote:
> >>
> >> To see how to call a listener in a component, see here:
> >>
> >> http://weblogs.java.net/blog/driscoll/archive/2008/12/jsf_20_wiring_u_1.html
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>