6 Replies Latest reply on Jun 25, 2009 9:07 PM by demetrio812

    Can't reRender a binded h:panelGrid

    demetrio812

      Hi,
      I've binded a h:panelGrid that generate a list of components based on an array.

      I also have an a:commandButton to add an element to the array and regenerate the UIPanel of the binded component.

      The problem is that it is not updating, the list is inside a conversation (the component is outjected with EVENT scope) so if I refresh the page from the browser the panel is updated but if I reRender it doesn't work.

      The strange thing is that it doesn't work also with h:commandButton.

      Also, if I try to render the content of the UIPanel inside an h:outputText I can see it is updated after pushing the button.

      This is m code:

      @Name("advancedSearchHelper")
      @Scope(ScopeType.CONVERSATION)
      public class AdvancedSearchHelper {
       ...
      
       @Out(scope = ScopeType.EVENT, required = false)
       UIPanel dynamicPropertiesUI;
      
       ...
      
       @Factory(value = "dynamicPropertiesUI", autoCreate = true)
       public void fillIn() {
       HtmlPanelGrid mainPanel = new HtmlPanelGrid();
       mainPanel.setColumns(1);
       for (GenericSearchProperty property : getProperties()) {
       mainPanel.getChildren().add(property.getPropertyPanel());
       }
       dynamicPropertiesUI = mainPanel;
       }
      
       ...
      
      }
      


      and the XHTML is:

      <h:form>
       <h:panelGrid id="propertiesPanel" columns="1">
      
       <h:panelGrid binding="#{dynamicPropertiesUI}"/>
      
       #{dynamicPropertiesUI.children.size()}
      
       <a:commandButton action="#{advancedSearchHelper.addSearchProperty}" value="+" ajaxSingle="true"
       reRender="propertiesPanel" />
       </h:panelGrid>
      </h:form>
      
      


      How can I solve this?

      Thank you!

      Demetrio