0 Replies Latest reply on Jun 20, 2008 6:42 AM by Markus -

    How to add uicomponents dynamically to a4j:outputPanel?

    Markus - Newbie


      i have a outputPanel and i want to add uicomponents dynamically to it:

      <a4j:outputPanel id="pgroup">
      <webuijsf:button text="test" actionListenerExpression="#{testBean.select}"/>
      <a4j:commandButton value="test2" actionListener="#{testBean.select}"/>

      My server bean code looks like this:
      FacesContext ctx = FacesContext.getCurrentInstance();
      UIComponent c = ctx.getViewRoot().findComponent("form1:pgroup");
      if (c != null)
       com.sun.webui.jsf.component.Button b1 = new Button();
       com.sun.webui.jsf.component.Button b2 = new Button();

      When i click the "webuijsf:button" it works. But when i click the "a4j:commandButton" it doesn't work. The buttons are not shown. I know that richfaces-ajax must known the ids. But how i can say to richfaces that i have added dynamic components on server side. There are a lot of use cases where dynamic tables, lists or oder things are needed which are not known at design-time. How richfaces supports this request.

      Thanks in advance.