Thanks for the reply.

For some reason the ColumnDecorator approach didn't work but a
TableDecorator did. 

Regards,

Thad Smith

-----Original Message-----
From: Justin James [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 02, 2005 12:27 PM
To: [email protected]
Subject: RE: [displaytag-user] FW: Unusual request

Use sortProperty which hangs off the column tag.  The sort property can
come directly from the data object or can be provided by the decorator.
In your case, you might want to use a column decorator, and add a method
"getIdAsInteger()" which converts the String to Integer.  Then make the
sort property for the ID column, idAsInteger.  e.g.
  
<display:column property="id" title="ID" headerClass="sortable"
sortProperty="idAsInteger" decorator="com.package.IdColunmDecoartor" />

HTH,
Justin

-----Original Message-----
From: Smith, Thad [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 02, 2005 9:50 AM
To: [email protected]
Subject: [displaytag-user] FW: Unusual request


I'm new to using displaytag, but am very impressed at how easily and
powerfully it works. I'm developing an interface to a j2ee app that was
developed by another company. The problem I'm having is with sorting.

I'm required to use the entity beans in the other companies application
for retrieving the data. I then use your tag library to display lists of
the data like:

<display:table name="contactList" cellpadding="2" cellspacing="2"
border="0" defaultorder="ascending" defaultsort="1" sort="list">
        <display:column property="id" title="ID" headerClass="sortable"
href="ContactView.do" paramId="id" sortable="true" />
        <display:column property="name" sortable="true" />
        <display:column property="phone1" title="Primary Phone" />
        <display:column property="email" autolink="true" />
</display:table>

Everything works great, except for the ID column. The problem is that
the list that gets passed to me by the third party entity bean passes
the id field as a String, even though it's kept in the database as an
integer (specifically a Numeric type which can handle floats, but the
ids get generated from a sequence...hence an integer).

This presents a problem since sorting Strings sorts 4000 before 32. Is
there any way I can convert the value to an integer to be used as the
sorting value?

Regards,

Thad Smith



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time by
over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
displaytag-user mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user




-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user

Reply via email to