myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marius Kreis <m...@nulldevice.org>
Subject Re: HtmlCommandLink ActionListener throwing Exception
Date Thu, 13 Oct 2005 11:30:02 GMT
i thought i could use the method addActionListener... but 
setActionListener isn't working either.
it seems as if the error is not dependent of the actionListener but 
thrown if an HtmlOutputLink is clicked itself.... i just described the 
problem in another mail...

Mike Kienenberger wrote:
> setActionListener takes a MethodBinding which references an
> ActionListener, and not an ActionListener directly.   Create a custom
> MethodBinding pointing to your PropertyPageListener.
> 
> I think I made an example of doing this as an attachment to
> 
> http://issues.apache.org/jira/browse/MYFACES-331
> 
> On 10/12/05, Marius Kreis <mail@nulldevice.org> wrote:
> 
>>I'm trying to dynamically building a list of links whereas each of them
>>has an ActionListener.
>>
>>The code is like this:
>>
>>while(...) {
>>         HtmlCommandLink link = new HtmlCommandLink();
>>         link.setValue("link text");
>>         link.addActionListener(new PropertyPageListener());
>>         panel.getChildren().add(link);
>>}
>>(PropertyPageListener is implementing the ActionListener interface)
>>
>>The code is generating the links but when I click on one of them an
>>exception is thrown (see bottom of the mail).
>>
>>Any idea what's going wrong?
>>Is is correct to call the method addActionListener with an anonymous object?
>>
>>- Marius
>>
>>
>>
>>    exception
>>javax.servlet.ServletException:
>>org.apache.myfaces.component.html.ext.HtmlCommandLink
>>javax.faces.webapp.FacesServlet.service(FacesServlet.java:109)
>>org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
>>
>>    root cause
>>javax.faces.FacesException:
>>org.apache.myfaces.component.html.ext.HtmlCommandLink
>>org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
>>org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:233)
>>org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:219)
>>org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:330)
>>javax.faces.webapp.FacesServlet.service(FacesServlet.java:95)
>>org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)
>>
> 
> 


Mime
View raw message