I found 2 possible solutions in the archive:
1.
http://groups.google.com/group/web2py/browse_thread/thread/f162f35e4a84ee48/11524d762a9b1356
Is this incomplete? How process function is called?
2.
http://groups.google.com/group/web2py/browse_thread/thread/82fad17e26e1739a/c6a9cfd878653969
I ran application mentioned in the thread. This is probably close, but
complicated.
What is good and simple approach to this issue? I do not have much
experience with Ajax.
Thanks
Julius
that is really simple.
Julius
V Sobota, 19. jún 2010 o 00:41 -0700, mdipierro napísal(a):
Flash is not displayed in this place, elsewhere is working. Why?
Or, how let user know about the result of form submission?
V Sobota, 19. jún 2010 o 00:41 -0700, mdipierro napísal(a):
(the typical flash response however is best, though)
def search_bar():
form = FORM('Search ',INPUT(_name='qry'))
if form.process().accepted:
response.flash=''
if form.vars.qry:
redirect(URL('services', vars={'qry':form.vars.qry}))
return form{{=LOAD('default','search_bar')}}the ajax_trap=True fixed the form which nows call search_bar... but redirect(URL('services', vars={'qry':form.vars.qry})) is rendered inside the component....What I'm trying to do, is to include a simple form in the layout.html that calls a function (as it is now, with the ajax_trap trick), and if it is not empty, it will redirect to a different page (loading the whole page)....
if [some condition]:
form = SCRIPT('jQuery(function() {location = "%s"})' %
URL('default', 'services', vars=dict(qry=form.vars.qry), extension=False))