forms - How to find in GSP from which action of controller its been called? -


i new grails , got stuck issue.

i have 2 form's in single gsp search.gsp , have 2 actions in controller serach , results.

now when click on search button in 1 of gsp file takes me search action renders me search.gsp.at time should display me first form in it. when click results button in form take me results action.which has code line.

redirect(action:"search",params:[merchants:merchant,address:address])

this take me search action want display 2nd form in search.gsp..

my problem is

  • how can make search action once run out parameter's , once parameter's?
  • how determine in gsp action been called?

with advance thanks.

depending on how different forms are, may want consider having 2 separate gsp files (e.g., search.gsp , results.gsp). use render(view:'action', model:[...]) render different view in controller. clearer single file lots of conditionals.

otherwise, can find out action using ${params.action}, example:

<g:if test="${params.action == 'search'}">    text show if action search </g:if><g:else>    text show if action results </g:else> 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -