Hi,

As Jeff's wiki page notes the rowStyleClass can be used for this. Just to clarify though: when rowStyleClass evaluates to non-null then the returned value is output as the style-class for that row. When null is returned for rowStyleClass, the default (taken from rowClasses) applies.

Note, however, that this functionality is broken in tomahawk 1.1.3; when the method bound to rowStyleClass returns non-null, the *rowStyle* property (not the returned value) is accidentally output instead. So you'll need to use a snapshot of Tomahawk to get this working. Alternately, what I've done on a current project is subclass HtmlRenderer to fix the bug (just copy method renderRowStyle from svn trunk) and configure this in the faces config file as the renderer for tables::
   <renderer>
     <component-family>javax.faces.Data</component-family>
     <renderer-type>org.apache.myfaces.Table</renderer-type>
<!-- subclasses org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer -->
     <renderer-class>x.y.z.PatchedHtmlTableRenderer</renderer-class>
   </renderer>

Regards,

Simon

Jeff Bischoff wrote:
Ajit,

I have created a wiki page [1] that covers this. Please see especially my definition of dataTable and the rowStyleClass attribute in particular.

[1] http://wiki.apache.org/myfaces/ManagingDataScrollerPage

Regards,

Jeff Bischoff
Kenneth L Kurz & Asociates, Inc.

Ajit.T wrote:
Hi ,
    I have a requirement , wherein I click on one of the row of the
dataTable to view a document in right frame to the datable contained frame. The Background color of the clicked row is to be changed , and this change in color should persists until a next row in datatable is clicked. i.e at
any point of time have only one row clicked.

What could be the workaround for resetting the previous style class of row , when a new row is clicked? My rows of datatable have alternately two style
classes as of now .

Reply via email to