Yes. I have not tried it but something like this: #IN default.py def index(): return dict() def a_form(): if request.env.request_method=='POST': response.headers['web2py-component-command'] = \ 'web2py_ajax_page("GET","%s","","a_list")' \ % URL(r=request,f='a_list') return crud.create(db.table) def a_list(): return SQLTABLE(db(db.table.id>0).select())
#IN views/default/index.html {{extend 'layout.html'}} <div id="my_form">loading form ...</div> {{=LOAD('default','a_form',ajax=True,target="my_form")}} <div id="my_list">loading list ...</div> {{=LOAD('default','a_list',ajax=True,target="my_list")}} The {{=LOAD(..)}} embeds the components (a_list, a_form) via ajax and capture the response so that only components get updated on submission). The code: if request.env.request_method=='POST': response.headers['web2py-component-command'] = \ 'web2py_ajax_page("GET","%s","","a_list")' \ % URL(r=request,f='a_list') returns instructions to the page when a form is submitted. It tells the form to trigger an ajax call to the a_list component. You may need to debug this a little. On Jan 28, 6:07 am, selecta <gr...@delarue-berlin.de> wrote: > Does anybody have some experiences with creating dynamic content with > jquery? > I know the signal/slot system from qt and I have the feeling that > trigger/bind from jquery can do the same thing in web2py > > My idea is to have e.g. a list view (controller list) and a form > (controller form). Both are loaded via ajax onto the same page, when > the form is submitted (via ajax) and it has the right content the > controller form will return the trigger that updates the list view > (calls controller list). > Is this possible? Am I thinking in the right direction? > > Please help or guide me into the right direction. > > If I am to unclear please tell me and I will try to find a better > example -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.