[ http://jira.codehaus.org/browse/DISPL-195?page=comments#action_46783 ] 

Peter Luttrell commented on DISPL-195:
--------------------------------------

Roberta,

While this may add additional flexability for the look and feel, I need the 
ability to actually control the actual html generated so I can change it's 
functionality completely. This way it can work in the custom MVC environment 
for which I must operate in....

-peter

> Allow for customization of Sorting Anchors
> ------------------------------------------
>
>          Key: DISPL-195
>          URL: http://jira.codehaus.org/browse/DISPL-195
>      Project: DisplayTag
>         Type: Improvement
>   Components: Paging/Sorting
>     Reporter: Peter Luttrell

>
>
> DisplayTag provides the ability to override the output of the anchors used 
> for pagination, but not sorting. I need this to be able to use the DisplayTag.
> Here is the code to implement it:
> Add the following to TableProperties.java:
>    /**
>      * property <code>sort.th.link</code>.
>      */
>     public static final String PROPERTY_STRING_SORT_TH_LINK = "sort.th.link"; 
> //$NON-NLS-1$
>   /**
>     * Getter for the <code>PROPERTY_STRING_SORT_TH_LINK</code> property.
>     * @return String
>     */
>    public String getSortThLink()
>    {
>        return getProperty(PROPERTY_STRING_SORT_TH_LINK);
>    }
> Add the following to TableTag.properties:
>    sort.th.link=<a href="{0}">{1}</a>
> In TableTag.java, in the writeTableHeader method, replaced this code:
>    // creates the link for sorting
>    Anchor anchor = new Anchor(getSortingHref(headerCell), header);
>    // append to buffer
>    header = anchor.toString();
> with:
>    // create Object[] including the HREF for the sort and the header text
>    Object[] objects = {getSortingHref(headerCell).toString(), header};
>    // get sort th link
>    String sortedLinkFormat = this.properties.getSortThLink();
>    // merge the final result
>    header = MessageFormat.format(sortedLinkFormat, objects);
> The docs would need to change to reflect the additional configuration 
> parameter.
>    Name: sort.th.link
>    Default: <a href="{0}">{1}</a>
>    Description: Link to get you back to this page. Displayed in the column th 
> for sorting. {0}: Page Url; {1}: Column Title

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to