2 Replies Latest reply on May 25, 2009 5:47 AM by Ilya Shaikovsky

    rerender not working

    Scot Powell Newbie

      This may be a redundant post, but I don't understand why "PlotPanel" does not rerender, yet "StartDate" and "EndDate" work fine. "PlotPanel" is rendered correctly upon initialization, but never changes after that.

      Note - "PlotPanel" works if I don't use binding.



      <f:view>
       <body>
       <img src="images/DukeGuitar.jpg" class="floatLeft" height="82" width="96"/>
       <h1>#{dWRFD1.dWRFD1Title}</h1>
       <br clear="all" ></br>
       <table width="100%">
       <tr><td style="background-color: #200070" height="5"></td></tr>
       </table>
       <br clear="all" ></br>
      
      <h:form id="EBOTForm">
      
       <h:panelGrid columns="6">
       <label for="PeriodRange">Previous:</label>
      
       <h:selectOneMenu id="PeriodRange" value="#{dWRFD1Handler.range}" required="true">
       <f:selectItems value="#{dWRFD1Handler.ranges}" />
       <a4j:support event="onchange" reRender="PlotPanel, StartDate, EndDate" />
       </h:selectOneMenu>
      
       <label for="StartDate" >Start:</label>
       <h:outputText id="StartDate" value="#{dWRFD1Handler.startDate}" >
       <f:convertDateTime type="date" pattern="MM/dd/yy h a" />
       </h:outputText>
      
       <label for="EndDate" >End:</label>
       <h:outputText id="EndDate" value="#{dWRFD1Handler.endDate}">
       <f:convertDateTime type="date" pattern="MM/dd/yy h a" />
       </h:outputText>
      
       <h:commandButton id="downloadBTN" value="download" action="#{dWRFD1Handler.act}" style="width: 6em" />
      
       </h:panelGrid>
      
       <rich:tabPanel id="PlotPanel" binding="#{dWRFD1Handler.tabPanel}" width="85%">
       </rich:tabPanel>
      
      </h:form>
      
      </body>
      </f:view>
      


        • 1. Re: rerender not working
          Scot Powell Newbie

          After reading some more on problems similar to this, I tried wrapping the TabPanel in an <a4j:outputPanel>, but the "PlotPanel" still does not render, but the "StartDate1" does rerender within the panel.

          Any ideas as to what I'm missing here would be greatly appreciated.



           <h:form id="EBOTForm">
          
           <h:panelGrid columns="6">
           <label for="PeriodRange">Previous:</label>
          
           <h:selectOneMenu id="PeriodRange" value="#{dWRFD1Handler.range}" required="true">
           <f:selectItems value="#{dWRFD1Handler.ranges}" />
           <a4j:support event="onchange" reRender="PlotPanel, StartDate, EndDate" />
           </h:selectOneMenu>
          
           <label for="StartDate" >Start:</label>
           <h:outputText id="StartDate" value="#{dWRFD1Handler.startDate}" >
           <f:convertDateTime type="date" pattern="MM/dd/yy h a" />
           </h:outputText>
          
           <label for="EndDate" >End:</label>
           <h:outputText id="EndDate" value="#{dWRFD1Handler.endDate}">
           <f:convertDateTime type="date" pattern="MM/dd/yy h a" />
           </h:outputText>
          
           <h:commandButton id="downloadBTN" value="download" action="#{dWRFD1Handler.act}" style="width: 6em" />
          
           </h:panelGrid>
          
           <a4j:outputPanel layout="block">
           <a4j:outputPanel ajaxRendered="true">
           <rich:tabPanel id="PlotPanel" binding="#{dWRFD1Handler.tabPanel}" width="85%" renedered="true">
           </rich:tabPanel>
           <label for="StartDate1" >Start:</label>
           <h:outputText id="StartDate1" value="#{dWRFD1Handler.startDate}" >
           <f:convertDateTime type="date" pattern="MM/dd/yy h a" />
           </h:outputText>
           <h:messages/>
           </a4j:outputPanel>
           </a4j:outputPanel>
          
           </h:form>
          
          ****
          
          
          
          
           public HtmlTabPanel getTabPanel() {
           LOG.info("getTabPanel()");
           FacesContext context = FacesContext.getCurrentInstance();
           Application application = context.getApplication();
           tabPanel = (HtmlTabPanel) application.createComponent(HtmlTabPanel.COMPONENT_TYPE);
          
           for (Well well : getWells()) {
           HtmlTab tab = (HtmlTab) application.createComponent(HtmlTab.COMPONENT_TYPE);
           tab.setId("well_" + COUNTER);
           tab.setLabel(well.getName());
           HtmlGraphicImage graphicImage = (HtmlGraphicImage) application.createComponent(HtmlGraphicImage.COMPONENT_TYPE);
           graphicImage.setId("image_" + COUNTER++);
           String plotURL = getPlot(well);
           graphicImage.setUrl(plotURL);
           tab.getChildren().add(graphicImage);
           tabPanel.getChildren().add(tab);
           }
           return tabPanel;
           }


          • 2. Re: rerender not working
            Ilya Shaikovsky Master

            binding should be request scoped.