Quantcast

how to show saved status on same page where update called in GRAILS

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

how to show saved status on same page where update called in GRAILS

mswatcher

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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to show saved status on same page where update called in GRAILS

gauravchauhan
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:

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





--
Regards
Gaurav Chauhan
Contact No : +91-95607-66664 
Skype : chauhan.gaurav

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to show saved status on same page where update called in GRAILS

mswatcher
thanks for quick response Gaurav.
Can you provide a good link to learn Ajax &  sample?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to show saved status on same page where update called in GRAILS

Octavian Covalschi
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.
Can you provide a good link to learn Ajax &  sample?

--
View this message in context: http://grails.1312388.n4.nabble.com/how-to-show-saved-status-on-same-page-where-update-called-in-GRAILS-tp4333940p4334012.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



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to show saved status on same page where update called in GRAILS

gauravchauhan
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...


On Fri, Jan 27, 2012 at 10:49 AM, mswatcher <[hidden email]> wrote:
thanks for quick response Gaurav.
Can you provide a good link to learn Ajax &  sample?

--
View this message in context: http://grails.1312388.n4.nabble.com/how-to-show-saved-status-on-same-page-where-update-called-in-GRAILS-tp4333940p4334012.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






--
Regards
Gaurav Chauhan
Contact No : +91-95607-66664 
Skype : chauhan.gaurav

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to show saved status on same page where update called in GRAILS

mswatcher
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.??
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: how to show saved status on same page where update called in GRAILS

David
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


Loading...