1 Reply Latest reply on Oct 2, 2008 6:31 AM by Ilya Shaikovsky

    AjaxButton and MethodBinding generated by code

    Sascha Janz Master

      i use jboss 4.2.2 GA with seam 2.0.2

      i got a dynamic page, the components are generate by code.

      i got some error with AjaxButton

      the creation code is like this

       HtmlAjaxCommandButton ajaxbutton = new HtmlAjaxCommandButton();
       try {
       ajaxbutton.setId(getID("AJAXBUTTON"));
       if (map.get("action") != null && map.get("action").trim().length() > 5) {
       log.debug("action=" + map.get("action"));
       MethodBinding m = FacesContext.getCurrentInstance()
       .getApplication().createMethodBinding(map.get("action"),
       null);
       ajaxbutton.setAction(m);
       }
      
       if ( map.get("oncomplete")!= null) {
       log.debug("oncomplete " + map.get("oncomplete"));
       ajaxbutton.setOncomplete(map.get("oncomplete"));
       }
      
       if (map.get("rerender") != null ) ajaxbutton.setReRender(map.get("rerender"));
       log.debug("value=" + map.get("Value"));
       ajaxbutton.setValue(map.get("Value"));
      
       }
       catch(Exception e) {
       e.printStackTrace();
       }
      


      on the console i see errors like

      0:27:36,296 WARN [Interpolator] exception interpolating string: action=#{Session.editmodehinweis}
      javax.el.PropertyNotFoundException: Property 'editmodehinweis' not found on type com.my.session.SessionBean

      although it is there.

      when i click the button the function is called!!! so why do i get this error message?