2 Replies Latest reply on May 4, 2007 9:27 AM by ilya_shaikovsky

    Drop Down Menu problems?

    patrickmadden

      Hi I can't seem to get the menu's to work. Maybe they are just not yet prime time? I have the latest axaj4jsf, richfaces and seam from CVS and am using JBoss4.2.0.CR2. However, I had the same problem a while back on 4.0.5.GA (maybe 2 weeks ago?). Its the first time I've tried since then.

      I wrote my own menu bean but kept getting exceptions so I thought maybe I'll just stick the bean from the Rich Faces example code into my code and try that. For both beans it never seems to be able to find the actionListener and/or the action method.

      I added the managed bean to faces-config.xml as follows:

       <managed-bean>
       <managed-bean-name>bean</managed-bean-name>
       <managed-bean-class>org.richfaces.samples.dropdownmenu.Bean</managed-bean-class>
       <managed-bean-scope>session</managed-bean-scope>
       </managed-bean>
      



      Here is the bean code and below that is the exception:


      /**
       * License Agreement.
       *
       * JBoss RichFaces 3.0 - Ajax4jsf Component Library
       *
       * Copyright (C) 2007 Exadel, Inc.
       *
       * This library is free software; you can redistribute it and/or
       * modify it under the terms of the GNU Lesser General Public
       * License version 2.1 as published by the Free Software Foundation.
       *
       * This library is distributed in the hope that it will be useful,
       * but WITHOUT ANY WARRANTY; without even the implied warranty of
       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
       * Lesser General Public License for more details.
       *
       * You should have received a copy of the GNU Lesser General Public
       * License along with this library; if not, write to the Free Software
       * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       */
      
      package org.richfaces.samples.dropdownmenu;
      
      import javax.faces.event.ActionEvent;
      import org.richfaces.component.UIMenuItem;
      
      /**
       * @author $Autor$
       */
      public class Bean {
      
       private String width = "200px";
       private String jointPoint = "auto";
       private String direction = "auto";
       private String groupDirection = "auto";
       private int verticalOffset = 10;
       private int horizontalOffset =10;
       private String verticalOffsets = "10";
       private String horizontalOffsets ="10";
       private String event ="onmouseover";
      
       public String getEvent() {
       return event;
       }
      
       public void setEvent(String event) {
       this.event = event;
       }
      
       public String getWidth() {
       return width;
       }
      
       public void setWidth(String width) {
       this.width = width;
       }
      
       public String getJointPoint() {
       return jointPoint;
       }
      
       public void setJointPoint(String jointPoint) {
       this.jointPoint = jointPoint;
       }
      
       public String getDirection() {
       return direction;
       }
      
       public void setDirection(String direction) {
       this.direction = direction;
       }
      
       public String getGroupDirection() {
       return groupDirection;
       }
      
       public void setHorizontalOffset(int horizontalOffset) {
       this.horizontalOffset = horizontalOffset;
       }
      
       public int getHorizontalOffset() {
       return horizontalOffset;
       }
      
       public void setVerticalOffset(int verticalOffset) {
       this.verticalOffset = verticalOffset;
       }
      
       public int getVerticalOffset() {
       return verticalOffset;
       }
      
       public void setGroupDirection(String direction) {
       this.groupDirection = direction;
       }
      
      
      
      
      
       public void setHorizontalOffsets(String horizontalOffsets) {
       this.horizontalOffsets = horizontalOffsets;
       setHorizontalOffset(new Integer(this.horizontalOffsets).intValue());
       }
      
       public String getHorizontalOffsets() {
       return horizontalOffsets;
       }
      
       public void setVerticalOffsets(String verticalOffsets) {
       this.verticalOffsets = verticalOffsets;
       setVerticalOffset(new Integer(this.verticalOffsets).intValue());
       }
      
       public String getVerticalOffsets() {
       return verticalOffsets;
       }
      
      
      
      
       public void actionListener(ActionEvent event) {
       System.out.println("ActionEvent on " + event.getComponent().getId() + " & Phase is "+ event.getPhaseId());
       }
      
       public String action() {
       System.out.println("Action!!!");
       return "null";
       }
      }
      


      16:54:51,390 ERROR [STDERR] May 3, 2007 4:54:51 PM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/search.xhtml]
      javax.el.PropertyNotFoundException: Property 'actionListener' not found on type org.richfaces.samples.dropdownmenu.Bean
       at javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
       at javax.el.BeanELResolver.property(BeanELResolver.java:267)
       at javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
       at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
       at org.jboss.el.parser.AstPropertySuffix.getValue(AstPropertySuffix.java:53)
       at org.jboss.el.parser.AstValue.getValue(AstValue.java:67)
       at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
       at com.sun.facelets.el.ELText$ELTextVariable.toString(ELText.java:174)
       at com.sun.facelets.el.ELText$ELTextComposite.toString(ELText.java:115)
       at com.sun.facelets.compiler.CommentInstruction.write(CommentInstruction.java:38)
       at com.sun.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:39)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:280)
       at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:262)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:189)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:184)
       at org.ajax4jsf.framework.renderer.RendererBase.encodeChildren(RendererBase.java:121)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:809)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:571)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
       at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
       at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:53)
       at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
       at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
       at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:127)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:248)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
       at java.lang.Thread.run(Thread.java:595)
      


      Here is the xhtml code:

       <h:panelGrid id="menugrid" columns="1" cellspacing="4">
       <ddm:dropDownMenu event="#{bean.event}"
       id="DocumentTreeMenuID"
       verticalOffset="#{bean.verticalOffset}"
       horizontalOffset="#{bean.horizontalOffset}"
       popupWidth="#{bean.width}"
       value="#{messages['documents.mysearches']}"
       jointPoint="#{bean.jointPoint}"
       direction="#{bean.direction}">
      
       <mc:menuItem id="closeMenuItemID"
       value="Close"
       mode="ajax"
       actionListener="#{bean.actionListener}"/>
       <mc:menuItem id="saveMenuItemID"
       mode="ajax"
       value="Save"
       actionListener="#{bean.actionListener}"/>
      
       </ddm:dropDownMenu>
       </h:panelGrid>
      


      Any help is greatly appreciated.

      Thanks,

      PVM