Paul,
I would love for us to start getting a good body of these decorators in
the code base. Is this what you were looking for?
Hope this helps,
Benjamin Simpson
Package my.definition.decorators;
Import my.definition.of.Address;
Public class AddressColumnDecorator implements ColumnDecorator {
Public String decorate(Object obj) throws DecoratorException {
If(object == null || obj instanceof Address == false)
return ""; // throw new DecoratorException("Class cast or null, you
choose" + obj);
Address address = (Address) obj;
Return new StringBuffer(256)
.append(address.getStreet())
.append("<br>")
.append(address.getCity())
.append(", ")
.append(address.getState())
.append(' ')
.append(address.getZip())
.toString();
}
}
<display:column property="homeAddressObj"
decorator="my.definition.decorators.AddressColumnDecorator" />
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Paul
McCulloch
Sent: Friday, November 07, 2003 3:50 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [displaytag-devel] ColumnDecorator
Since the addition of the implicit row object in 1.0-b1 I've replaced
all my
ColumnDecorators with code in the body of the <column>tag. I think this
is a
far nicer approach - I can create a custom tag to do any custom
formatting &
re-use the tag anywhere - not just inside a <table>.
You can use this approach to solve the problem you mention with the
jstl:
<display:column sort="true">
<fmt:formatDate value="${current.dateLogged}" type="date"
dateStyle="SHORT" timeStyle="SHORT"/>
</display:column>
Does anyone have any examples of formatting that can be done with a
column
decorator, but not via column body?
Paul
-----Original Message-----
From: Brad Smith [mailto:[EMAIL PROTECTED]
Sent: 07 November 2003 03:38
To: [EMAIL PROTECTED]
Subject: [displaytag-devel] ColumnDecorator
One use of the ColumnDecorator (a good addition) is to format dates
correctly according to the locale of the user. In order for the locale
information to be available to the decorator, a reference to the request
object needs to be available, correct? Would it make sense to extend the
ColumnDecorator class with a method for passing a reference to the
request object? This could be called once at class initialization.
Comments?
--
Brad Smith <[EMAIL PROTECTED]>
**************************************
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If
you are not the addressee indicated in this message (or responsible for
delivery of the message to such person), you may not copy or deliver
this message to anyone. In such case, you should destroy this message,
and notify us immediately. If you or your employer does not consent to
Internet email messages of this kind, please advise us immediately.
Opinions, conclusions and other information expressed in this message
are not given or endorsed by my Company or employer unless otherwise
indicated by an authorised representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from
being transmitted via electronic mail attachments we cannot guarantee
that attachments do not contain computer virus code. You are therefore
strongly advised to undertake anti virus checks prior to accessing the
attachment to this electronic mail. Axios Systems Ltd grants no
warranties regarding performance use or quality of any attachment and
undertakes no liability for loss or damage howsoever caused.
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel
-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel