문제

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.

도움이 되었습니까?

해결책

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top