0 Replies Latest reply on Oct 12, 2011 12:33 PM by pushpak1981

    JSF Extended datatable inside rich tab

    pushpak1981

      Hi,

       

      I am facing some issue with Extended data table inside rich tab. I have two rich tab each having their own extended data table. I have written a Datamodel for these datatable. Both the datatable point to the same datamodel class and are identified by some parameter inside the data model class. When i switch the tabs some request is send to the server and data model is populated. But some times it happens that datamodel is updated but is not rendered onto the UI so i see the old data on the page. We added some SOPL into the datamodel which verified that datamodel walk method is called but the data is not rendered into the UI.

       

      Any help would be appreciated.

       

      Thanks.

       

      <ui:define name="body">

              <rich:panel style="border:1;" width="100%">

                  <f:facet name="header">

                      <h:outputText

                          value="#{webInterfaceList.getParsedNavigationString(request.requestURL)}"

                          escape="false" />

                  </f:facet>

       

       

                  <!-- helper function to explicitly reRender top datascroller -->

                  <a4j:form>

                      <a4j:jsFunction name="setTabId">

                          <a4j:actionparam name="tabId"

                              assignTo="#{ListDataModel.tabId}" />

                      </a4j:jsFunction>

                  </a4j:form>

       

                  <rich:tabPanel switchType="server">

       

                      <rich:tab id="LiveTab" label="Live" onlabelclick="setTabId('Live')">

       

                          <a4j:form id="SearchLive" styleClass="edit">

       

                                  <!-- requestDelay variable added in template.xhtml -->

                              <a4j:queue requestDelay="#{requestDelay}"

                                  ignoreDupResponses="true" size="1"

                                  sizeExceededBehavior="dropNext" />

       

                              <h:outputText value="The  search returned no results."

                                  rendered="#{ListDataModel.size == 0}" />

       

       

                              <a4j:outputPanel ajaxRendered="true">

                                  <rich:datascroller id="ListDataScrollerLive1"

                                      reRender="ListDataScrollerLive2"

                                      for="ListLive" align="left" maxPages="20"

                                      renderIfSinglePage="true" />

                              </a4j:outputPanel>

                              <rich:spacer height="10" />

                                                     

                              <rich:extendedDataTable id="ListLive"

                                  var="_" value="#{ListDataModel}" rows="20"

                                  rendered="#{ListDataModel.size > 0}"

                                  reRender="ListDataScrollerLive1,ListDataScrollerLive2"

                                  onRowMouseOver="this.style.backgroundColor='#E5E5E5'"

                                  onRowMouseOut="this.style.backgroundColor='#FFFFFF'"

                                  rowClasses="transViewL1,transViewL2">

                             

                                  <rich:column label="Id" filterBy="#{_.id}"

                                      filterEvent="onkeyup" selfSorted="true"

                                      sortBy="#{_.id}">

                                      <f:facet name="header">

                                          <h:outputText value="Id" />

                                      </f:facet>

                                      <h:outputText value="#{_.id}" />

                                  </rich:column>

                                  <rich:column label="Activator"

                                      filterBy="#{_.activatorType}" filterEvent="onkeyup"

                                      selfSorted="true" sortBy="#{_.Type}">

                                      <f:facet name="header">

                                          <h:outputText value="Type" />

                                      </f:facet>

                                      <h:outputText value="#{_.Type}" />

                                  </rich:column>                           

                                  <f:facet name="footer">

                                      <h:outputText

                                          value="Total Count: #{ListDataModel.rowCount}" />

                                  </f:facet>

                              </rich:extendedDataTable>

                              <rich:spacer height="10" />

                              <a4j:outputPanel ajaxRendered="true">

                                  <rich:datascroller id="ListDataScrollerLive2"

                                      reRender="ListDataScrollerLive1"

                                      for="ListLive" align="left" maxPages="20"

                                      renderIfSinglePage="true" />

                              </a4j:outputPanel>

                         

                          </a4j:form>

                      </rich:tab>

       

                      <rich:tab id="HistoryTab" label="History" onlabelclick="setTabId('History')">

       

                          <a4j:form id="SearchHistory" styleClass="edit">

                             

                             

                                  <!-- requestDelay variable added in template.xhtml -->

                              <a4j:queue requestDelay="#{requestDelay}"

                                  ignoreDupResponses="true" size="1"

                                  sizeExceededBehavior="dropNext" />

                             

                              <h:outputText value="The  search returned no results."

                                  rendered="#{ListDataModel.size == 0}" />

       

                              <a4j:outputPanel ajaxRendered="true">

                                  <rich:datascroller id="ListDataScrollerHistory1"

                                      reRender="ListDataScroller2"

                                      for="ListHistory" align="left" maxPages="20"

                                      renderIfSinglePage="true" />

                              </a4j:outputPanel>

                              <rich:spacer height="10" />

                             

                                                     

                              <rich:extendedDataTable id="ListHistory"

                                  var="_" value="#{ListDataModel}" rows="20"

                                  rendered="#{ListDataModel.size > 0}"

                                  reRender="ListDataScrollerHistory1,ListDataScrollerHistory2"

                                  onRowMouseOver="this.style.backgroundColor='#E5E5E5'"

                                  onRowMouseOut="this.style.backgroundColor='#FFFFFF'"

                                  rowClasses="transViewL1,transViewL2">

                             

                                  <rich:column label="Id" filterBy="#{_.id}"

                                      filterEvent="onkeyup" selfSorted="true"

                                      sortBy="#{_.id}">

                                      <f:facet name="header">

                                          <h:outputText value="Id" />

                                      </f:facet>

                                      <h:outputText value="#{_.id}" />

                                  </rich:column>

                                  <rich:column label="Activator"

                                      filterBy="#{_.activatorType}" filterEvent="onkeyup"

                                      selfSorted="true" sortBy="#{_.activatorType}">

                                      <f:facet name="header">

                                          <h:outputText value="Type" />

                                      </f:facet>

                                      <h:outputText value="#{_.Type}" />

                                  </rich:column>                           

                                  <f:facet name="footer">

                                      <h:outputText

                                          value="Total Count: #{ListDataModel.rowCount}" />

                                  </f:facet>

                              </rich:extendedDataTable>

                             

                              <rich:spacer height="10" />

                              <a4j:outputPanel ajaxRendered="true">

                                  <rich:datascroller id="ListDataScrollerHistory2"

                                      reRender="ListDataScrollerHistory1"

                                      for="ListHistory" align="left" maxPages="20"

                                      renderIfSinglePage="true" />

                              </a4j:outputPanel>

       

                          </a4j:form>

                      </rich:tab>

       

                  </rich:tabPanel>

       

                  <rich:modalPanel id="modalPanel" width="1200" height="700">

                      <f:facet name="controls">

                          <h:panelGroup>

                              <a onclick="#{rich:component('modalPanel')}.hide();" href="#">Close</a>

                          </h:panelGroup>

                      </f:facet>

                      <rich:spacer height="20" />

                      <iframe name="test" id="test" width="1100" height="650"

                          scrolling="auto" frameborder="0"></iframe>

                  </rich:modalPanel>

              </rich:panel>

          </ui:define>