6 Replies Latest reply on Oct 4, 2007 7:38 AM by Alexander Belov

    datascroller needs refresh to show up properly

    Mikael Andersson Master

      Hi I have a small problem with datascroller.

      Libraries:
      rf 3.1.0
      myfaces 1.1.5
      Facelets 1.1.12

      The backing bean "runningTasks" is in session scope. When clicking the commandButton the data is loaded into the session bean given the specified settings ( from the page).

      When I first display a page, the scroller isn't shown but after refreshing the page it is shown properly. Same happens when I modify the settings to reload the data in the backing bean.

      I can't quite figure out what I'm doing wrong, can you :)

      Below is the code for the page where I have [cut] I removed some verbose settings html code.

      <body>
      
       <h:form id="runningTasksForm">
       <rich:panel id="settings">
       <f:facet name="header">
       Settings
       </f:facet>
       <h:panelGrid columns="3" columnClasses="top,top,top">
       <rich:panel id="startSetting">
       <f:facet name="header">
       Start Time
       </f:facet>
       [cut]
       </rich:panel>
      
       <rich:panel id="endSetting">
       <f:facet name="header">
       End Time
       </f:facet>
       [cut]
       </rich:panel>
      
       <rich:panel id="miscSetting">
       <f:facet name="header">
       Misc. Settings
       </f:facet>
       [cut]
       </rich:panel>
       </h:panelGrid>
       <h:commandButton value="Apply" action="#{runningTasks.fetchData}"/>
       </rich:panel>
      
       <rich:spacer height="10px"/>
       <rich:tabPanel switchType="server">
      
       <rich:tab label="Table View">
      <center>
       <h:outputText value="No tasks to display" rendered="#{empty runningTasks.runningTasks}"/>
      
       <rich:datascroller id="taskTableScroller"
       maxPages="5"
       for="taskTable"
       renderIfSinglePage="false"
       />
      
       <br/>
      
       <rich:dataTable id="taskTable"
       align="left"
       onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       value="#{runningTasks.runningTasks}"
       rendered="#{not empty runningTasks.runningTasks}"
       rows="25"
       var="task">
      
      
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column colspan="5">
       All ( #{runningTasks.taskCount} ) Tasks
       </rich:column>
       </rich:columnGroup>
       </f:facet>
       <ui:include src="/jsf/rtv/tableCols.xhtml"/>
       </rich:dataTable>
       </center>
       </rich:tab>
      
       <rich:tab label="Scrolling Table View">
      
       <h:outputText value="No tasks to display" rendered="#{empty runningTasks.runningTasks}"/>
       <h:outputText value="#{runningTasks.taskCount} in total" rendered="#{not empty runningTasks.runningTasks}"/>
       <a4j:status>
       <f:facet name="start">
       <h:outputText
       value="FETCHING DATA"/>
       </f:facet>
       <f:facet name="stop">
       <h:outputText
       value=""/>
       </f:facet>
       </a4j:status>
       <rich:scrollableDataTable
       id="taskTableScrollable"
       rowKeyVar="rkv"
       frozenColCount="1"
       height="400px"
       width="500px"
       onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
       onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"
       value="#{runningTasks.runningTasks}"
       rendered="#{not empty runningTasks.runningTasks}"
       rows="50"
       sortMode="single"
       var="task">
      
       <ui:include src="/jsf/rtv/tableCols.xhtml"/>
       </rich:scrollableDataTable>
       </rich:tab>
      
       <rich:tab label="Chart View" disabled="true">
       Here is tab #2
       </rich:tab>
       </rich:tabPanel>
       <rich:messages/>
       </h:form>
       <ui:debug hotkey="m"/>
      </body>