2 Replies Latest reply on Jun 29, 2008 12:03 AM by aish

    Issue with ScrollableData Table

    aish

      Hi,

      Please help me with the scrollabledatatable problem in the below code. The code has 2 date fields "From Date and To Date". when the date is changed, the scrollabledatatable should be refreshed with the records based on the selected dates.

      The date selection works fine, the records are selected as expected but the scrollabledatatable displays the selected records with no headers. When we right click the mouse and select refresh, the header for the scrollabledatatable is displayed properly with the records. The users will be annoyed if we ask them to refresh the table after evey date change in order to get the scrollabledatatable with headers.

      Can you please pass on your suggestions to display the scrollabledatatable with headers when the refresh happens. Your help is very much appreciated. I have been spendng last couple of days with this.

      thanks
      Aish


      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

      <rich:spacer height="5px" id="ErrorTable_spacer"></rich:spacer>

      <h:panelGrid columns="5" style="width:670px" id="ErrorTable_pGrid1">
      <h:outputText value="From Date : " styleClass="topicStyle" id="ErrorTable_oText1"/>

      <rich:calendar value="#{TableDetail.errorFromDate}"
      popup="true"
      datePattern="#{TableDetail.pattern}"
      showApplyButton="false"
      style="width:150px"
      disabled="#{TableDetail.selected == true}"
      oncomplete="alert('To date cannot be greater than from date');"

      id="ErrorTable_calendar">
      <a4j:support ajaxSingle="true" event="ondateselected" reRender="ErrorTable_oPanel" id="ErrorTable_support"/>
      </rich:calendar>

      <h:outputText value="To Date : " styleClass="topicStyle" id="ErrorTable_oText2"/>
      <rich:calendar value="#{TableDetail.errorToDate}"
      popup="true"
      datePattern="#{TableDetail.pattern}"
      showApplyButton="false"
      style="width:100px"
      disabled='#{TableDetail.selected == true}' id="ErrorTable_calendar1">
      <a4j:support ajaxSingle="true" event="ondateselected" reRender="ErrorTable_oPanel" id="ErrorTable_support1"/>
      </rich:calendar>



      </h:panelGrid>

      <a4j:outputPanel id="ErrorTable_oPanel">

      <rich:scrollableDataTable rowKeyVar="errorrkv"
      height="200px" width="510px"
      id="errortest" value="#{TableDetail.errortbl}"
      var="error" sortMode="single"
      selection="#{TableDetail.scrollableErrorDataTableSelection}"
      focus="errortest" onRowClick="ErrorRowClick()">

      <rich:column width="95px">
      <f:facet name="header">
      <h:outputText value="Field1" id="ErrorTable_oText3"/>
      </f:facet>
      <h:outputText value="#{error.field1}" id="ErrorTable_oText4"/>
      </rich:column>

      <rich:column width="95px">
      <f:facet name="header">
      <h:outputText value="Field2" id="ErrorTable_oText5" />
      </f:facet>
      <h:outputText value="#{error.field2}" id="ErrorTable_oText6"/>
      </rich:column>

      </rich:scrollableDataTable>
      </a4j:outputPanel>