History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-1346
Type: Improvement Improvement
Status: Reopened Reopened
Priority: Major Major
Assignee: Sergey Nebolsin
Reporter: Dmitriy Kopylenko
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
Grails

Make <g:paginate> tag produce URLs aware of custom URL Mappings

Created: 03/Jul/07 10:03 AM   Updated: 25/Apr/08 06:56 AM
Component/s: TagLib
Affects Version/s: 0.5.6
Fix Version/s: 1.0.4

Time Tracking:
Not Specified

File Attachments: 1. Text File RenderTagLib.groovy.patch (0.9 kb)

Environment: Jdk 1.5, Mac OSX
Issue Links:
dependent
 


 Description  « Hide
<g:paginate> tag currently produces URLS based on the default $controller/$action pattern This is not always desireble. For example in my applications I completely disable $controller/$action/$id URL patter and use solely "custom" URL patterns. For this scenario, g:paginate would not work. For example, for the following mapping:

"/people"{ controller = 'person' action = 'list' }

<g:paginate> tag would produce "/my-app/person/list?offset=10&max=10" instead of desirable "/my-app/people?offset=10&max=10"



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Sergey Nebolsin - 29/Aug/07 07:00 AM
Dmitry, this issue should be fixed now together with GRAILS-1540. I tested it locally and it seems to work as expected.

Could you please confirm if it works fine for you with SVN HEAD.


Neil Bacon - 23/Apr/08 07:35 PM
Hi, its not fixed for me.
Generation of reverse mapped URLs by ApplicationTagLib.createLink() (used by <g:createLink>, <g:link> and <g:paginate>) seems to depend on the ordering of params in the LinkedHashMap. e.g. only works if 1st param in URL is first param in the map. I'm not sure if this is a necessary limitation or a bug.

Anyway, with the above limitation, <g:paginate> can never produce reverse mapped URL's because it inserts its own params before those provided by the controller. The attached patch just puts the orig params in first and fixes this problem for me.


Peter Ledbrook - 24/Apr/08 01:53 AM
Re-opening so the latest comment and patch aren't lost/forgotten.