5 Replies Latest reply on Jun 3, 2010 4:02 AM by svkap

    reRender HtmlPanelGroup children

    svkap

      Hello.

       

      I have some problems with rerendering of HtmlPanelGroup. I have tried using HtmlAjaxCommandLink + rerender, HtmlAjaxSupport + onclick + rerender but nothing works. I assume that just the component cannot be found to be rerendered but I do not know why. Here is my jsf page:

       

       

      My backing bean is generating the content. In short I have 3 HtmlPanelGroups generated inside (as children) and each of them has several children. When I click on the command link panelRoot.getChildren().clear(); is called, all children are generated again with different values and finally the new HtmlPanelGroups are added to panelRoot as children. I can see that in the backing bean the children are generated as expected but the panelRoot is not rerendered. Here is part of my code:

       

       

              HtmlAjaxCommandLink linkNextPage = new HtmlAjaxCommandLink();
              linkNextPage.setId("linkNextPage_id_" + uniqueId);
              linkNextPage.setValue("Next");
              linkNextPage.setDisabled(!isNextPageAvailable());
              linkNextPage.setReRender(panelRoot.getId());
              linkNextPage.addActionListener(nextPageListener);
      
      //        HtmlAjaxSupport asNextPage = new HtmlAjaxSupport();
      //        asNextPage.setId("ajax_nextPage_id_" + uniqueId);
      //        asNextPage.setEvent("onclick");
      //        asNextPage.setReRender("panelRoot_id");
      //
      //        linkNextPage.getChildren().add(asNextPage);
      

       

      Thank you.

        • 1. Re: reRender HtmlPanelGroup children
          nbelaevski

          Hi Svetoslav,

           

          Try assigning explicit IDs to panel.

          • 2. Re: reRender HtmlPanelGroup children
            svkap

            Hi Nick.

             

            I am actually using explicit id for the panelRoot (set in the JSF page). panelRoot.getId() returns the correct ID. I have tried using the id ("panelRoot_id") as string instead of panelRoot.getId() but the result was the same.

            • 3. Re: reRender HtmlPanelGroup children
              harut

              try to enclose panelGroups inside the <a4j:outputPanel ajaxRendered="true">

              • 4. Re: reRender HtmlPanelGroup children
                svkap

                Hi.

                 

                I tired that but unfortunately it did not work . Here is a part of my jsf page:

                 

                 

                         <h:form id="form_id" >
                             <a4j:outputPanel ajaxRendered="true">
                                 <h:panelGroup layout="block" id="panelRoot_id"
                                     style="width:580px;" binding="#{bean.panelRoot}">
                                 </h:panelGroup>
                             </a4j:outputPanel>
                         </h:form>
                
                • 5. Re: reRender HtmlPanelGroup children
                  svkap

                  Hi.

                   

                  This was mistiriously fixed. I have only changed panel ID and panel bindnig property and it is working fine now.

                   

                   

                  <h:panelGroup layout="block" id="panelRoot_id_Test" style="width:580px;" 
                                  binding="#{bean.panelRootTest}" />
                  

                   

                   

                  I do not know why it is working now but I am happy .