I have built an advanced search option that allows users to search a multitude of different fields - 38 possible fields in total.
Once the initial search has been submitted, 10 results are displayed with pagination options at the bottom (using grails' <g:paginate>
tag).
I think I have a few problems here.
1) I need to somehow pass the fields back to the controller using the params
attribute of the g:paginate
tag, but I don't really want to create a params map of 40 something parameters.
2) I pass back to the page from the Controller a map of search parameters (so that they can have a dismissable list of parameters that perform the search again without the dismissed parameter). I can pass this back in the params
attribute, but it's passed back to the controller as a String
and not a map
so I don't know how to iterate through it (I realised this after it iterated through each separate character!).
3) The URL of the links that the g:paginate
tag creates could potentially be massive, depending on how much of the search fields the user enters. Could there be a danger of the URL exceeding it's maximum amount?
I'm contemplating changing from the built in grails paginate functionality, and creating a form which I can POST. I'm not sure if this is the best way though, and I may be missing some alternative way to do this that is much better.
Any help greatly received!