>
> 3- when the asynchronous callback finishes the result2() functions runs
> and redirects to the segunda() function. The segunda() function will
> perform some calculation with the data and present the results to the user
> in segunda.html.
>
All this is working until the redirection part. It should send me to
> default/segunda.html but instead it just show the starting index.html
> page. If I write the url default/segunda.html I can see the correct
> information.
>
The problem is that your call to result2 is an ajax call, so although the
redirect to segunda does return the segunda.html output to the browser, the
browser has no instruction to do anything with that (the browser does not
simply replace the current page with the response to any ajax call that is
made -- that would make ajax largely useless for most purposes). If you
want the result of an ajax call to replace the main page that makes the
call, you have to do that in Javascript in the browser when the ajax call
completes. web2py includes some built-in functionality to do this:
redirect(URL(c='default',f='segunda'), client_side=True)
With the above, web2py will not do a standard redirect. Instead, it will
simply return to the browser with an instruction for the browser to reload
the main page with the redirect URL.
Anthony
--
---
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.