2 Replies Latest reply on Dec 6, 2011 7:44 AM by Maximilian Faupel

    dynamic panel group not re-rendered

    Maximilian Faupel Newbie

      Hi,

       

      I want to create a dynamic panel group each time a value in a combo box is selected, but the getter is not called when the component is re-rendered. I know that it works with the value attribute of an output text. Is there a way to re-render a value binding? Thank you in advance.

       

      Maximilian

       

       

       

      <rich:panel>
          <h:form id="dynamicPanelGroupForm">
              <h:selectOneMenu>
                  <f:selectItem itemValue="1" itemLabel="one" />
                  <f:selectItem itemValue="2" itemLabel="two" />
                  <a4j:support event="onchange" actionListener="#{dynamicPanelGroupBean.refreshPanelGroup()}" reRender="panelGroup" />
              </h:selectOneMenu>
           <h:panelGroup id="panelGroup" binding="#{dynamicPanelGroupBean.panelGroup}" />
          </h:form>
      </rich:panel>
      

       

      @AutoCreate
      @Scope(ScopeType.EVENT)
      @Name("dynamicPanelGroupBean")
      public class DynamicPanelGroupBean {
          private HtmlPanelGroup panelGroup;
      
          public void refreshPanelGroup() {
              FacesContext context = FacesContext.getCurrentInstance();
              panelGroup = (HtmlPanelGroup) context.getApplication().createComponent(
                      HtmlPanelGroup.COMPONENT_TYPE);
              HtmlEditor editor = (HtmlEditor) context.getApplication()
                      .createComponent(HtmlEditor.COMPONENT_TYPE);
              panelGroup.getChildren().add(editor);
          }
      
          public void setPanelGroup(HtmlPanelGroup panelGroup) {
              this.panelGroup = panelGroup;
          }
      
          public HtmlPanelGroup getPanelGroup() {
              return panelGroup;
          }
      }