4 Replies Latest reply on Apr 23, 2007 1:45 PM by Sergey Smirnov

    rich:datatable question..

    rachana patel Newbie

      Hi,

      Following is my code which uses <rich:datable>. I fire gototurnOn() on onRowClick event. gototurnOn takes control to turnOn action os backing bean.

      <rich:dataTable id="searchresDataTable"
       binding="#{backing_CustSearchBean.searchresDataTable}" headerClass="isell_header"
       onRowMouseOver="this.style.backgroundColor='#ECF2FE'"
       onRowMouseOut="this.style.backgroundColor='#FFFFFF'"
       var="myList" value="#{processScope.rsBean.custInfoDao}"
       style="margin-top: 5px; cursor: pointer;overflow: auto;"
       styleClass = "dt_normal"
       rowClasses="searchcusttoprow,searchcustrows"
       onRowClick="gototurnOn('#{myList.first_name}', '#{myList.last_name}', '#{myList.country}', '#{myList.phone}','#{myList.email}'); showAllWheel('form1:srchwheel');"
       columnClasses="searchcustcols,searchcustmidcols,searchcustcols"
       >
       <rich:column>
       <h:outputText value="#{myList.first_name}" style="margin-left: 5px;"/>
       <h:outputText value=" "/>
       <h:outputText value="#{myList.last_name}"/>
       <h:panelGrid style="margin-left: 5px;">
       <h:outputText value="#{myList.country}"/>
       </h:panelGrid>
       </rich:column>
       <rich:column>
       <h:outputText value="#{myList.address}" style="margin-left: 5px;"/>
       <h:panelGrid columns="2" border="0" style="margin-left: 5px;">
       <h:outputText value="#{myList.city}"/>
       <h:outputText value="#{myList.state}"/>
       </h:panelGrid>
       </rich:column>
       <rich:column>
       <h:panelGrid border="0" columns="1" style="text-align: left; margin-left: 1px;" >
       <h:outputText value="#{myList.email}"/>
      
       <h:outputText value="#{myList.phone}" style="text-align: right;" />
       </h:panelGrid>
       </rich:column>
      
       </rich:dataTable>
      
       <a4j:jsFunction name="gototurnOn" action="#{backing_CustSearchBean.TurnOn}" oncomplete="enableOpp();stopAllWheel('form1:srchwheel');" >
       <a4j:actionparam name="custFName"/>
       <a4j:actionparam name="custLName" />
       <a4j:actionparam name="custCountry" />
       <a4j:actionparam name="custPhone" />
       <a4j:actionparam name="custEmail" />
       </a4j:jsFunction>
      

      Can it be possible that the row which is selected in datatable gets highlighted when the control comes back from the turnOn action. Somehow i have to indicate to user, which row he has selected.

      Please help...
      Thanks in advance!!