The action associated to {{=LOAD(....)}} could return a response.js and it
would be executed by the client after the ajax post.
On Saturday, 14 March 2015 05:47:24 UTC-5, Garry Smith wrote:
>
> Hi
>
> I 'm running the following code which inserts a user into a room for
> registration.
> Every thing works fine.
> I have a table on the same page which shows the results,
> I need the page to refresh to show updated results after the code below
> has run, is their a way of doing this?
>
>
> Controller results():
>
> rm = session.room
> pd = session.period
> bars = request.vars.id
>
>
> db.register.update_or_insert(upn_no=bars,room=rm,period=pd)
> return ()
>
>
> View (only what's relevant)
>
> {{extend 'layout.html'}}
>
> {{LOAD('default', 'results',ajax=True
> <form><input type="hidden" id="id" name="id" value="" /></form></div>
>
>
> {{for s in sur:}}
> <span onclick="jQuery('#id').val('{{=s.upn_no}}');
> ajax('{{=URL('default', 'results')}}', ['id'],
> 'bar{{=s.upn_no}}');">{{=s.first_name}} {{=s.surname}} Year {{=s.year}}
> -click to reg</span><br />
>
> {{pass}
>
>
>
>
--
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/d/optout.