0

I am trying to implement an ajax form with remoteForm in grails. I want to do email verification on server side so I want the emailForm div to be viewed after submit but some input values will change. However my problem is that the form needs some variables that are in pageScope and I loose them after the submit. How can I prevent this?

<div id="emailForm">
   <g:formRemote  name="sendEmailsForm" url="[controller:'con', action:'emails']" method="POST" update="emailForm">
   </g:formRemote>
</div>

emails.gsp

<g:render template="widgets/shareByEmailNew" model="${pageScope.variables}" model="${pageScope.variables}"/>
Ela
  • 3,142
  • 6
  • 25
  • 40
  • in the con controller emails action do println "${params}" are you seeing all the variables including the missing ones ? pagescope is for the current page and ajax call is no longer original pagescope - you need to probably have onComplete action which uses ajax to go off and query the result set where that page is being rendered.. https://github.com/vahidhedayati/grails-wschat-plugin/blob/38c6297cce03d6ccfea3b280723c135a15a7a2a1/grails-app/views/room/_delaRoom.gsp. Also look at https://github.com/vahidhedayati/mailinglist this kind of does this but not ajax sends to next action – V H Sep 03 '15 at 15:24
  • This probably comes a bit late and you have solved it. Try looking into jquery and ajax form.serialize() (pageScope values mapped as data to be pushed back) https://jira.grails.org/browse/GRAILS-3708 http://stackoverflow.com/questions/10398783/jquery-form-serialize-and-other-parameters – V H Dec 09 '15 at 10:10

0 Answers0