aspose file tools*
The moose likes JSF and the fly likes JSF: tomahawk dataTable rowStyleClass problem while applying alternate colors to rows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF: tomahawk dataTable rowStyleClass problem while applying alternate colors to rows" Watch "JSF: tomahawk dataTable rowStyleClass problem while applying alternate colors to rows" New topic
Author

JSF: tomahawk dataTable rowStyleClass problem while applying alternate colors to rows

vennila Selvaraj
Greenhorn

Joined: Oct 10, 2007
Posts: 5
Hi All,

I am trying to apply alternate colors to rows in a tomahawk dataTable, but I cannot get it to work.
Any help will be greatly appreciated.

Versions used :
tomahawk- 1.1.8
myfaces- 11-1.0.0

jsp Code:
<t:dataTable id="data" headerClass="cell-scrollable-header"
footerClass="standardTable_Header"
rowClasses="OddRow,EvenRow"
border="0" var="user" renderedIfEmpty="false"
value="#{MyBackingBean.resultList}"
preserveDataModel="false" rows="10">

Css :

tr.OddRow{
background-color: cyan;
width: 250px;

}

tr.EvenRow{
background-color: red;
width: 250px;

}

If I see the output background colors are not applied to rows.

But in view source I can see the odd rows are taking styleclass OddRow and even rows are taking EvenRow.


I do not know why the background color is not applying.

Your help is greatly expected.

Thanks,
Vennila

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Your CSS is not been picked up by the webbrowser.

Is it inline in the HTML head or in an external file?

If inline, then you have a serious problem. If external file, then its URL is likely wrong.
vennila Selvaraj
Greenhorn

Joined: Oct 10, 2007
Posts: 5
Hi Bauke,

Thanks for the reply.

Css is from external file.
But I think the URL of the CSS file is picked by the web browser as the other styles given in that external file is picked and working correctly.

Please suggest.

Thanks,
Vennila

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
If you recently changed the CSS, then you should do a hard refresh in your webbrowser. Use CTRL+F5 or so. It may still be cached by the webbrowser. Particularly MSIE is known about this.

If not done yet, do an appserver restart as well.
vennila Selvaraj
Greenhorn

Joined: Oct 10, 2007
Posts: 5

Yes, I did ctrl+F5, cleared my browser cache, restared my tomcat then also it is not working.

I am able to see the style changes - "background-color" as red for evenrow and cyan for oddrow in IE Developer Toolbar.
But the color is not getting affected.

Is there any limitation because of the version tomahawk- 1.1.8 and myfaces- 11-1.0.0 used ?
Please tell me how it can be resolved.

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
No, it's a client side problem. Your CSS is not been picked up or it is been overridden by another styles. Verify your CSS file. To start, try removing or outcommeting everything in the CSS file expect of those two styles. Also remove or outcomment any other CSS files which gets loaded.
vennila Selvaraj
Greenhorn

Joined: Oct 10, 2007
Posts: 5

Yes, css style for row is overridden by css style for column.

Thanks and cheers ,
Vennila
 
jQuery in Action, 2nd edition
 
subject: JSF: tomahawk dataTable rowStyleClass problem while applying alternate colors to rows
 
Similar Threads
customize tomahawk schedule component
JSF Datatable: How to style first row <tr>
How to print total page including css background?
formatting dataTable
Datatable rows onMouseOut color change