aspose file tools*
The moose likes JSF and the fly likes How to apply CSS to JSF Datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to apply CSS to JSF Datatable" Watch "How to apply CSS to JSF Datatable" New topic
Author

How to apply CSS to JSF Datatable

jomol jin
Greenhorn

Joined: Dec 12, 2007
Posts: 8
Can anyone help me in changing the default style of the
jsf datatable, <webuijsf:table>???
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

I guess you're talking about the Woodstock JSF components here. You can use style attribute to apply the CSS, e.g.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
jomol jin
Greenhorn

Joined: Dec 12, 2007
Posts: 8
hello sir thanks for your reply

even after giving the style unable to change the table layout color
if the style is given for <webuijsf:tableColumn> it affects only the rows and columns, also unable to give different colors for each row.
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

The last time I tried JSF Woodstock, it also didn't seem to be very CSS friendly, especially with color. It somehow forces you to use its default color. I never like it
Pankaj Tiwari
Ranch Hand

Joined: Sep 11, 2005
Posts: 55
for the JSF componenets of sun visual web pack of netbeans there is .css file in which you can override the existing colors and size, so i guess in this case also there has to be some css file..may be in war or somewhere. Other option that i saw over there is that even if there is no css if you create a sylesheet.css file then the components take that.
This is all with respect to jsf components with netbeans
jomol jin
Greenhorn

Joined: Dec 12, 2007
Posts: 8
thanks for the response
so there is no way to apply style for <webuijsf:table>, other than
changing the built-in css of netbeans, so i think better to use h:datatable itself.
jomol jin
Greenhorn

Joined: Dec 12, 2007
Posts: 8
hello sir,

i used this <webuijsf:table> because pagination can be done very simply in it, now what i need is to apply style for it. But even after using style, the background color is not get affected on the table. Can anyone please help me in coloring a jsf datatable???
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Although, I have no experience with wood stock reference implementation, but after reading Freddy's response, I believe you should be able to solve it by compiling one of your own after downloading its source. This way you would be able to contribute to the project as well by submitting your fixes to the project.

Cheers.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Have you already checked RichFaces or MyFaces to see if they are having your desired component? I bet, there you will definitely find something, after all these are two of the leading JSF implementations.
jomol jin
Greenhorn

Joined: Dec 12, 2007
Posts: 8
hello sirs,

i have applied style for h:datatable, but since the woodstock components provide pagination i depend on it, but even though pagination was working perfectly i was unable to color the table.
From this forum can i conclude that in woodstock components we cannot apply style sheet according to our need, and for this purpose we have to depend richfaces or myfaces
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by jomol jin:
From this forum can i conclude that in woodstock components we cannot apply style sheet according to our need, and for this purpose we have to depend richfaces or myfaces


Scary, I must say. Well, I would say don't conclude anything like that, try it yourself, download the source code, dig into it, and see where is the problem. After that you will be able to see much more clearer. In fact, Wood Stock implementation is not very popular, and apparently has less users.
Pankaj Tiwari
Ranch Hand

Joined: Sep 11, 2005
Posts: 55
http://developers.sun.com/jscreator/learning/tutorials/2/stylesheets_comps.html

It has some pointers
el mahdi arjdane
Greenhorn

Joined: Jun 08, 2009
Posts: 1
hi pankaj,

i dont why i cant access the link you have posted
am redirected to http://developers.sun.com/jscreator/

any idea???

thanks
Martin Lopez Ochoteco
Greenhorn

Joined: May 28, 2009
Posts: 15
Hi, I'm using Tomahawk dataTable and I can say is CSS friendly and also has a paginator.
Sorry, I have no experience with Woodstock JSF components.


JM.-
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to apply CSS to JSF Datatable