You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jon Pearson <Jo...@sixnet.com> on 2009/05/01 14:18:00 UTC
RE: OGNL in HTML tags
> > I'm trying to colorize table rows in a JSP based on the result of a
> > function call into the Action. Here's what I want to do:
> >
> > <tr class="%{getStatus(deviceID)}">
> > ...
> > </tr>
> >
> > And have the function "String getStatus(long deviceID) {
> ... }" look
> > up the status of a device and return a CSS class name (such as
> > 'normal', 'warning', or 'error').
> >
> > But OGNL doesn't execute in non-Struts2 tags... Is there a
> > straightforward way to do this? At the moment, I'm thinking
> I need to
> > implement my own tag library that will add a Struts2-like "tr" tag.
>
> <tr class="<s:property value="%{getStatus(deviceID)}"/>">
>
> Dave
Thanks, that worked.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org