views:

202

answers:

1

Hi All,

I am developing a web app in Grails and I need to redirect my current page to another controller, passing to it multiple parameters.

The exact scenario will be to have a from with multiple SELECT menus and have on them all a call to this controller on their "onChange" property, passing to it the current value of all the SELECT menus as parameters.

It is important that the full page should be refreshed in order to show the new content generated by that controller and the new combination of the SELECT menus.

Thank you very much,

knithx.

+1  A: 

You can do something like this:

<g:form id="myform" controller = "someOtherController" name="myForm" action="selectChange" id="1">
    <g:select name = "animal" from="${['Dog', 'Cat', 'Mouse']}" onchange="this.form.submit()" />
    <g:select name="vegetable"  from="${['Carrot', 'Potato', 'Squash']}" onchange="this.form.submit()" />
</g:form>
Mike Sickler
Great solution! Thanks :)
knx