Because in response.flash='Update bedrijfsgegevens' form=update_form(...)
response.flash is set before update_form which calls crud.update and perform a redirection. response.flash is reset upon redirection. On Nov 18, 2:19 am, annet <annet.verm...@gmail.com> wrote: > In a controller I have the following function: > > def update_company(): > response.view='company/update.html' > response.flash='Update bedrijfsgegevens' > form=update_form > (db.bedrijf,company_id,'update_company','Bedrijfsgegevens > gewijzigd',False) > return dict(form=form) > > I defined the update_form function in db.py, it reads like: > > def update_form(table,record,next,message,deletable): > form=crud.update(table,record,next=(URL > (r=request,f=next)),message=message,deletable=deletable) > if request.function=='update_company' or > request.function=='update_paymentdata' or > request.function=='update_address': > form[0][-1][1].append(INPUT > (_type="button",_value="Cancel",_onclick="window.location='%s';"%URL > (r=request,f='index'))) > else: > form[0][-1][1].append(INPUT > (_type="button",_value="Cancel",_onclick="javascript:hostory.go(-1)")) > return form > > Now when I expose the function I expect the flash to read like: Update > bedrijfsgegevens. And after I > updated the data I expect it to read like: Bedrijfsgegevens gewijzigd, > because I set message=message, > however, the flash still read like: Update bedrijfsgegevens. > > In the manual I read: message is the flash message upon form > acceptance. Why doesn't this work? > > Kind regards, > > Annet. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web2py@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 -~----------~----~----~----~------~----~------~--~---