Thanks David!

+1 from me for adding it. Fabrizio is the maintainer and approver of the codebase though - since he wrote it.

Matt

On Jun 25, 2004, at 10:04 AM, David Erickson wrote:

Ok here is a revised version of the patch, it passes all maven tests that
the current version on CVS does. Once again to reiterate its use and
usefulness here is what it offers:


You can now use taglibraries inside the coumn tag to manipulate its output
while maintaining the ability to sort the column, etc.
For example:
<display-el:column property="userName" title="UserName" sortable="true"
class="displayTag">
<a href="<html-el:rewrite
forward="admin.user.editUser"/>?id=<bean:write name="user" property="id"/>"
target="_top"><bean:write name="user" property="userName"/></a>
</display-el:column>


Allows me to sort by username, and infact the column will still display the
username, however it will be a link to another area on the site, and its
pulling in additional variables from that row at the same time. This is
significantly easier than writing a ColumnDecorator IMO, and doesn't require
manually rebuilding source code to make modifications.. (your container
should just rebuild the jsp when changes are noticed). This has been
immensely useful all over our site, another example would be if you want to
display dates differently than the standard date output format:


<display-el:column property="expirationDate" title="Expires"
sortable="true" class="displayTag">
<logic:notEmpty name="user" property="expirationDate"><dt:format
pattern="MM/dd/yyyy"><bean:write name="user"
property="expirationDate.time"/></dt:format></logic:notEmpty>
</display-el:column>


You will note that this column is still sortable, however it will display
exactly the date I want and its very easy to change and do this within the
jsp.


One further example we have an area on the site that lists files a user can
download, I'm using a FileWrapper around the java.io.File type to expose
length and another variables as a java bean property. We know that length
is output in bytes, but we want to display the value in kb to the end user
(yes i realize my algorithm here isnt perfect but it works).. so an example
of that:


<display-el:column property="length" title="Size"
sortable="true" class="displayTag AlignRight">
<%=
((FileWrapper)pageContext.findAttribute("file")).getLength().longValue( ) /
1024 %>kb
</display-el:column>


Anyway I hope Fabrizio and Matt you can see the usefulness of this.. it
eliminates needing to have a ton of decorator classes always getting
compiled, its VERY simple to use taglibs inline... etc.. I really hope this
makes it into V1.0 because there have been an immense amount of people on
the user list looking for answers to questions that this would easily help
solve.
-David
<ColumnTag.patch>



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to