You should probably ColumnDecorator since you want to use it in several
places. Here is an example of how to do that.


// in the jsp
<display:column property="dataAvailable" title="Has Data"
decorator="com.microsoft.BooleanColumnDecorator" />

// in the decorator ZeroColumnDecorator
public class ZeroColumnDecorator implements DisplaytagColumnDecorator
{
      /**
     * retrieve the html decorate string
     */
    public String decorate(Object rowObject, PageContext pageContext,
MediaTypeEnum media)
    {
        String display = "";
        if (rowObject instanceof Integer)
        {
            Integer value= (Integer)rowObject;
                // build the html
            display=(value.intValue()>0)?value:"";
        }
        return display;
    }
}



On Tue, Nov 25, 2008 at 4:02 PM, DM <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I would like to prevent zero values from being displayed in a HTML table
> that I generate with displaytag. It seems like implementing a decorator
> would be the most convenient way to achieve this, but I'm not sure whether I
> should be exending TableDecorator or PageDecorator?
>
> If someone could let me know which of these 2 is the most appropriate, and
> give me some pointers regarding which methods to override, it would be much
> appreciated. I would like to be able to use this decorator in any table,
> i.e. the decorator should not depend on the table retrieving it's data from
> beans of a particular class
>
> Thanks in advance,
> Don
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> displaytag-user mailing list
> displaytag-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>



-- 
Jeff
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
displaytag-user mailing list
displaytag-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to