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]



Reply via email to