0 Replies Latest reply on Aug 24, 2009 1:55 PM by Vladimir Pasquier

    Problem Seam Button (Java API) with ActionListener

    Vladimir Pasquier Newbie

      Hello everyone,

      I'm using seam for one project and would like to generate some graphic seam component dynamically by java from a backing bean.

      Basically, my button is generated graphically thanks to this piece of code:

      |HtmlButton button =(HtmlButton)application.createComponent(HtmlButton.COMPONENT_TYPE);
                MethodExpression vef1 = ef.createMethodExpression(context.getELContext(), "#{boFacade.processAction}" ,null,  new Class[] {ActionEvent.class});
              MethodExpressionActionListener actionListener = new MethodExpressionActionListener(vef1);
              MethodBinding test=application.createMethodBinding("#{boFacade.processAction}",new Class[] {ActionEvent.class});
                button.setValue("Action Seam");|

      My problem is that my actionListener is not registered and not generated in the xhtml page. Method Binding is deprecated as the method createMethodBinding. This is may be the source of problem... I very found of s:button component, would like so much to generate that from my bean.

      Have another problem like that with a4j:include (UIInclude from java API)... but i will post that in richfaces forum.

      Thanks for your help.