8 Replies Latest reply on Jan 14, 2009 7:39 AM by Onur Kocer

    How to keep selected row marked after re-open page in dataTa

    Ingo Dietz Newbie

      I'm using a dataTable. When a button of a record is clicked in the table, the clicked row is marked as selected (via javascript) and a new detail-page is openend (no modal-panel!). After the detail-page is closed, the page with the dataTable is shown again. That all is working fine.

      But when the dataTable-page is shown again, the selected record is not marked as selected any more.

      Is it possible to keep the selected row marked or mark it again after opening the page again (via javascript e.g.) ?

      I alread looked at 'Specific row update' (http://java.dzone.com/articles/an-introduction-to-jboss-richf?page=0%2C5) that might be a possible beginning. But i didn't managed to mark the row again. I also tried to work with "rowKeyVar" and "pageIndexVar".

      Does anybody has an idea or could give an advise, please?

      Here is the short-version of the data-table

      <rich:dataTable value="#{orders}" var="item" id="test"
       reRender="scroller" >
      <a4j:support event="onRowClick" onsubmit="markRow(this, #{rowNo})" />
      <rich:column filterBy="#{item.orderId}" sortBy="#{item.orderId}" filterEvent="onkeyup" headerClass="columnheader" >
       <f:facet name="header" >
       <h:outputText value="#{msg['ps.ui.orderId']}" />
       <h:outputText value="#{item.orderId}" />
       ...some more columns...
       <rich:column headerClass="columnheader" >
       <h:commandButton id="btnEdit" action="#{orderHandler.loadDetails(item)}" image="page_edit.png" />
       <f:facet name="footer">
       <rich:datascroller id="scroller" pageIndexVar="pageNo" renderIfSinglePage="false"/>

      Many thank for your help.