• Post Reply Bookmark Topic Watch Topic
  • New Topic

Color table.  RSS feed

 
Leinka Sm
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am begining with the JSF world, I am trying a color table as the google image one.

I have a dynamic list of colors, so i don't know the elements in the table.
With Javascript is easy, you can make a for loop and fill the table. I am looking for JSF examples with datatables but i dont know very well how make this table because in JSF each column is a different variable and in this case I have one variable (color) but i want 4 columns. Is there another way to do this? I don't know if i am looking for in the right way.

Regards, Leinka.

 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can define a rectangular area such as a "div" or a 1x1 panelGrid. Set the desired color as a property: 'style="background-color: #{mybean.cellColor}"'.

Watch out, though, since the CSS convention for hex codes begins with "#" and the EL marker for EL expressions is also '#', the "getCellColor" method needs to return a string like so:



Or, if it's easier, just don't use the hex codes and use color names or decimal color code values.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!