Feature Requests item #823393, was opened at 2003-10-14 05:18 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=536616&aid=823393&group_id=73068
Category: main taglib Group: v 1.0-b1 Status: Open Resolution: None Priority: 7 Submitted By: Paul McCulloch (paulmcculloch) Assigned to: andy pruitt (rapruitt) Summary: Sort by property even when a column body is declared Initial Comment: It would be useful to allow the specification of a property and a body to the column tag. The body is used for display whilst the property is used for sorting. For example, I prefer to use column body, rather than decorators for formatting of dates: <display:column title="Date" sort="true"> <fmt:formatDate value="${row.dateLogged}" type="date" dateStyle="SHORT" timeStyle="SHORT"/> </display:column> This allows me to use nice existing tags for date formatting. Unfortuantly the sorting is done of the resulting formatted text - not date order. By allowing both property & body to be passed this can be achieved. This can be achieved (at fiirst glance!) by changing ColumnTag.java roundabout line 741 from: if (mProperty == null) to: if (mProperty == null || (mProperty != null && getBodyContent() != null)) ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2004-02-05 08:18 Message: Logged In: NO +1: the ability to format cell content inside the body of the column tag, while still being able to sort using the non-formatted non-decorated property would be really helpful. To me, when there is a body content, it should always be used for display (else, why would one put a body content in the first place?). If there is just a content, it should be used for display and sorting (what else could we use for sorting?) If a property is defined, in addition to the content, this property should be used for sorting. Adding a "comparator" attribute, containing the name of a class implementing the Comparator interface, would also be a nice addition. For example, suppose we have a month property containing a String constant representing a month ("JANUARY", "FEBRUARY", etc.). Suppose we want to render the month in an internationalized way (using resource bundles), and suppose we want to sort the table by month (January first, December last). With this proposition, it's plain simple: <display:column property="month" comparator="com.blabla.MonthComparator" sortable="true"> <fmt:message key="month.label.${month}"> </display:column> If the month property contains an integer (1 for January, 2 for february, etc.), there is no need for comparator anymore: <display:column property="month" sortable="true"> <fmt:message key="month.label.${month}"> </display:column> ---------------------------------------------------------------------- Comment By: Torgeir Veimo (pivot) Date: 2003-12-01 01:29 Message: Logged In: YES user_id=201434 what about a different attribute name for the sort property? We patch displaytag locally allowing a sortProperty attribute which is used for this purpose. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=536616&aid=823393&group_id=73068 ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ displaytag-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-devel