Something like this might work as well:
if form.process().accepted:
response.js = 'location.reload(true);'
return 'Success' # this shouldn't matter, as it won't get displayed
That is like hitting the browser refresh, so would attempt to re-post any
post data, but I don't think that would be a problem in this case since the
previous post happened via Ajax to a different URL. Another option would be:
if form.process().accepted:
response.js = 'location.href = location.href;'
return 'Success' # this shouldn't matter, as it won't get displayed
No issue with post data in that case, though if there is a "#" in the URL,
it won't actually reload the page (would just attempt to jump to the anchor
after the "#").
Anthony
On Friday, January 24, 2014 4:55:43 PM UTC-5, Tim Richardson wrote:
>
> I have a form I want to use on a number of controller function views, so I
> have used LOAD.
> I want this form to reload its parent page.
> I still want to keep it modular, so hard-coding the parent URL in the
> LOADed controller function is not useful.
> I have done this:
>
>
>
> {{=LOAD('default','choose_saasu_file.load',ajax=True,vars={'parent_controller':request.controller,'parent_function':request.function})}}
>
> and then in the LOADed controller function: (EDIT: extension=False is
> required otherwise it looks for a .load view, inherited from the LOAD
> request)
>
> ...
> if form.process().accepted:
> ...
> redirect(URL(request.vars.parent_controller,request.vars.
> parent_function,extension=False),client_side=True)
>
>
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.