problem with MenuButton

UI Components for JSF
Post Reply
orjatar
Posts: 9
Joined: 08 Jun 2010, 15:22

08 Jun 2010, 15:30

Hi everybody!!!!!!!

I'm trying to use a MenuButton and I have this problem.

I have a bean like this:

Code: Select all

@ManagedBean(name = "usuariosBean")
public class UsuariosBean 
{

    public void initUsuarios( ActionEvent actionEvent)
    {
        System.out.println("Im in");
    } 
}
and a page (menu.xhtml) with an actionListener in my button:

Code: Select all

<p:menuitem id="init" value="Init" actionListener="#{usuariosBean.initUsuarios}" />
The action listener must go to the method an show on console "Im in", but I have an exception:

Code: Select all

GRAVE: javax.el.PropertyNotFoundException: /menu.xhtml @22,77 actionListener="#{usuariosBean.initUsuarios}": Target Unreachable, identifier 'usuariosBean' resolved to null
	at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:100)
	at javax.faces.event.MethodExpressionActionListener.processAction(MethodExpressionActionListener.java:148)
	at javax.faces.event.ActionEvent.processListener(ActionEvent.java:88)
	at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:772)
	at javax.faces.component.UICommand.broadcast(UICommand.java:300)
	at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:775)
	at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1267)
	at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
	at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
	at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Thread.java:619)
If I use another kind of button, like <p:commandButton> I don't have problems with the action, but with the MenuButton, never reach the method.
Any solution????

Lots of thanks!!!

:]

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

09 Jun 2010, 10:07

This is very strange yes, if commandButton works it should work as well.

And the showcase is working fine so can't figure out what the problem is;

http://www.primefaces.org:8080/prime-sh ... button.jsf

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 40 guests