4 Replies Latest reply on Jan 5, 2011 3:37 AM by Xiaofeng Feng

    HtmlMenuItem actionListener error

    Xiaofeng Feng Newbie

      HtmlMenuItem menuItem = new HtmlMenuItem();

      menuItem.setValue(menu.getMenuName());

      menuItem.setId("menu_"+menu.getMenuCode());
      menuItem.setIcon(menu.getMenuImage());

      menuItem.setReRender("tabPanel");

       

      FacesContext facesContext = FacesContext.getCurrentInstance();
           menuItem.setActionExpression(facesContext.getApplication()
              .getExpressionFactory().createMethodExpression(
              facesContext.getELContext(),
              "#{bimp_admin_mainBB.excuteMenuAction}", null, new Class[]{ActionEvent.class}));

       

       

      method

      public void excuteMenuAction(ActionEvent actionEvent) {
        
        HtmlMenuItem menuItem = (HtmlMenuItem)actionEvent.getSource();
        HtmlTab tab = new HtmlTab();
        tab.setName(menuItem.getValue());
       
        this.tabPanel.getChildren().add(tab);
      }

       

      error info

      java.lang.IllegalArgumentException - wrong number of arguments

       

       

      any help is very much appreciated.
      thanks!