Thanks, Eric. Can you describe where and how I would add such a condition?
In a new bean? Within the .page file? Tap newbie here... :)
rowsClass="ognl:row.statusName == 'active' ? 'active' : null"
I think null will work here, but if not, use 'default' or something like that. Now in your CSS add a style for class 'active' which is green for the background color.
There is another step here, and that is to have the row handy:
row="ognl:row" on the table.
Then add a <property-specification name="row"/> in the .page file.
Erik
-----Original Message----- From: Erik Hatcher [mailto:[EMAIL PROTECTED] Sent: April 14, 2005 8:21 PM To: Tapestry users Subject: Re: Row color based on content?
On Apr 14, 2005, at 4:56 PM, Roland Chan wrote:
I'd like to specify a row color based on some content. For example, the row should be background color green if the statusName column has a value of 'active'.
Can anyone direct me on what the most efficient way of doing this is.
My table currently looks like this:
<table border="1" cellspacing="1" bordercolor="#FFFFFF" width="100%" jwcid="[EMAIL PROTECTED]:Table" class="pcpList" source="ognl:procedure.numberedSteps" columns="stepNo, truncatedInstruction, statusName, primaryName" pageSize="5">
Add a rowsClass attribute. To zebra-stripe a table, I do this:
rowsClass="ognl:beans.evenOdd.next + 'Row'"
with the EvenOdd bean defined in the .page file like this:
<bean name="evenOdd" class="org.apache.tapestry.bean.EvenOdd"/>
You can add whatever condition you like, though.
Erik
<span jwcid="[EMAIL PROTECTED]"> <span jwcid="stepNoLink"> <span jwcid="stepNoText"></span> </span> </span> </table>
Thanks, Roland
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
