To get this kind of output...

        <td class="severityLevel">
                <div class="highseverity">
                        99
                </div>
        </td>

...try putting a div in a t:parameter and varying the div's class, eg.

        <t:grid t:source="alarms" t:row="alarm">
                <t:parameter name="severityLevelCell">
                        <div class="${severityLevelClass}">
                                ${alarm.severityLevel}
                        </div>
                </t:parameter>
        </t:grid>

In java add a getSeverityLevelClass() method that returns the css class as a String.

String getSeverityLevelClass() {
        int level = getAlarm().getSeverityLevel();
        switch (level)
                etc, returning the css class appropriate to the level
}

Geoff

On 03/07/2008, at 4:54 PM, vzhou wrote:


Hi, All,

I'm using a Grid component to show an alarm table which requires display different font color based on severity level (a string parameter in data
model).  Any suggestions on how to customize grid cell's font color or
background color?

Thanks a lot,
-victor
--
View this message in context: 
http://www.nabble.com/Grid-cell-with-customized-font-color-tp18252686p18252686.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to