I have a gsp page which I developed using Grails. I have a dropdown list at the top of the page which acts as a filter. I need to display the data using that filter value. How can I do that ?
1. Have a button you can click that submits a form to the server with the filtered item and return an appropriate response
2. Use JavaScript to create an onChange event that then posts the form back to the server
3. #2 but use ajax for the post, sending back an appropriate response.
Are you having any specific issues or is this a general question?
I'm having specific issues. Is there any way to submit the form with the use of an dropdown list or clicking of a check box in Grails. I want to avoid too many clicks to see the data.
#2/#3 in my previous post or add a click event using Javascript to the checkbox to submit the form. None of this is Grails specific. It's just HTML/JavaScript. Can you tell us the specific issues you mention?
here is what is happening. I had written the stuff using the <select tag and using the remotefunction in the onchange attribute. For some reasons when I update my div it actually duplicated the navigation bar.
I don't know why that's happening. I tried to take a look at the DOM and I couldn't find the references to the duplicate nav bar in the DOM and hence I wanted to see if there is any other route to take.
You're probably seeing the duplicated nav bar because you are returning a response that includes it. Without seeing your controller code, this is just a guess, but if you are rendering a GSP as the response, it is going to pick up the layout, which includes the navbar. You should be rendering a template instead.
I'm controller includes the standard code for what a typical list method would output. It just returns a map of all the instances and the total. Couple of questions
1) How do I log what I'm getting from response ?
2) How can I just render the template ?