|
I am trying to save some values to data base,so created a simple form with two text fields and a button in GSP (info.gsp). when button(update) pressed called method update() on controller.& saved the changed.good till here. def update (){ def proxy = session.proxy def sql = "UPDATE tbl_SystemStatus SET inSync = "+params.inSync+",available = "+params.available def gf = proxy.gwReceiveSql("default", sql) /* please help what to do so that the below is rendered to my called page*/ render "Saved to table" // it ask for view update.but i want t go back on same page. } and want to show "saved " on the same gsp (info.gsp) with the saved new values. render takes me to a new page. Please help. Please help how to do it. thanks Sana |
|
Make an Ajax call. :-)
Take a look at formRemote http://grails.org/doc/2.0.x/ref/Tags/formRemote.html
On Fri, Jan 27, 2012 at 9:57 PM, mswatcher <[hidden email]> wrote:
Regards Gaurav Chauhan Contact No : +91-95607-66664 Skype : chauhan.gaurav Website : JellyFish Technologies
|
|
thanks for quick response Gaurav.
Can you provide a good link to learn Ajax & sample? |
|
You could also add a flash message and redirect to the same or another page which will display that message... all you need to do to check in your template if flash.message is empty or not...
On Fri, Jan 27, 2012 at 10:49 AM, mswatcher <[hidden email]> wrote: thanks for quick response Gaurav. |
|
Just take a look at sample usage of formRemote. It should serve your purpose. Just google around and you will get it.
If you get stuck somewhere with formRemote , ask for help on mailing list... You will surely find some nice people who will answer your query.
Good luck
On Fri, Jan 27, 2012 at 10:30 PM, Octavian Covalschi <[hidden email]> wrote: You could also add a flash message and redirect to the same or another page which will display that message... all you need to do to check in your template if flash.message is empty or not... Regards Gaurav Chauhan Contact No : +91-95607-66664 Skype : chauhan.gaurav Website : JellyFish Technologies
|
|
thanks everyone.
I forget to mention one important thing is that i am using modalbox for this page. and able to do the needful but returned status shows the view in full screen not as modal. is there anyway to keep the page as modal box.?? |
|
In reply to this post by mswatcher
You should read the documentation. Found here: http://grails.org/Documentation
Skickat från min iPad 27 jan 2012 kl. 17:27 skrev mswatcher <[hidden email]>: > > I am trying to save some values to data base,so > created a simple form with two text fields and a button in GSP (info.gsp). > when button(update) pressed called method update() on controller.& saved the > changed.good till here. > > def update (){ > def proxy = session.proxy > def sql = "UPDATE tbl_SystemStatus SET inSync = > "+params.inSync+",available = "+params.available > def gf = proxy.gwReceiveSql("default", sql) > /* please help what to do so that the below is rendered to my called > page*/ > render "Saved to table" // it ask for view update.but i want t go back > on same page. > > } > and want to show "saved " on the same gsp (info.gsp) with the saved new > values. > render takes me to a new page. > > Please help. > > Please help how to do it. > > thanks > Sana > > -- > View this message in context: http://grails.1312388.n4.nabble.com/how-to-show-saved-status-on-same-page-where-update-called-in-GRAILS-tp4333940p4333940.html > Sent from the Grails - user mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
| Powered by Nabble | Edit this page |
