2 Replies Latest reply on Apr 25, 2007 2:18 AM by Carsten Hoehne

    Highlight selected row from richDatable (on a4j response ret

    rachana patel Newbie

      Hi,
      I had poseted this on forum before also. But I am not able to resolve it.

      I have to get the the selected row from rich:datatable highlighted when the a4j response has come back. If I apply the style on onRowClick, that style goes when the page comes back as this datatable is rerendered.

      I tried to save the reference of datatable in java script variable and get the row index from bean. I was thinking to use that row index oncomplete of jsFunction. But rowIndex is always 0 no matter which row I am selecting.

      Here is the code which explains above logic:

      <a4j:jsFunction name="showOppSelected" action="#{backing_CustSearchBean.getOppNoData}" oncomplete="alert('complete');enableOpp();stopAllWheel('form1:srchwheel');">
       <a4j:actionparam name="opp_name"></a4j:actionparam>
       </a4j:jsFunction>
       <a4j:outputPanel id="transInfo" ajaxRendered="true">
       <rich:dataTable
       cellpadding="0" cellspacing="0"
       width="100%" border="0"
       id="transtable"
       binding = "#{backing_CustSearchBean.transtable}"
       onRowMouseOver="this.style.backgroundColor='#ECF2FE';saveref(this);"
       onRowMouseOut="this.style.backgroundColor='#FFFFFF';"
       headerClass="bluebar"
       var="oppList" value="#{processScope.oppAllData}" onRowClick="this.style.backgroundColor='#F1F1F1';showOppSelected('#{oppList.opp_id}');showAllWheel('form1:transwheel');"
      
       >
       ....
      </rich:datatable>
      <a4j:outputPanel>


      It will be great if i can get some clue of how can i do it. I can iterate through the datatable but I dont the row which user had selected.

      Thanks in advance!