[web2py] Re: ajax update session data

2013-02-20 Thread Anthony
The process involves multiple steps -- activity on the server, followed by Javascript updates in the UI. If the UI doesn't update as expected, there is no reason to believe the problem must be with the code on the server -- the problem may be with the Javascript. I believe your code is updating

[web2py] Re: ajax update session data

2013-02-20 Thread 黄祥
no error occured, i'm expected to update the quantity value through form fields that user enter. nothing change, even after i refresh the page (F5), the value in quantity form field and in span is not update. i'm not sure what is running when i'm update the quantity form field and then press TAB

[web2py] Re: ajax update session data

2013-02-20 Thread Anthony
Rather than simply saying something didn't work, it helps if you can explain in more detail exactly what you expected and what happened instead. Did you get an error? How do you observe that it "didn't work"? On Wednesday, February 20, 2013 10:03:56 AM UTC-5, 黄祥 wrote: > > not worked. i've alrea

[web2py] Re: ajax update session data

2013-02-20 Thread 黄祥
not worked. i've already tried it, i'm trying to figure it out why it not work, but still can find the reason on the book. any idea about this? thank you very much -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this

[web2py] Re: ajax update session data

2013-02-20 Thread Anthony
Why not just session.order[id] = qty? On Wednesday, February 20, 2013 9:49:14 AM UTC-5, 黄祥 wrote: > > a, i c, so that's why it returns an error on the page. so is there a way > to set the session value? > i'm trying to do it with session.order.get(id, 0)*0+qty is not work too. > my goal is to up

[web2py] Re: ajax update session data

2013-02-20 Thread 黄祥
a, i c, so that's why it returns an error on the page. so is there a way to set the session value? i'm trying to do it with session.order.get(id, 0)*0+qty is not work too. my goal is to update the value with the user input value in the field. thank you so much in advance -- --- You received

[web2py] Re: ajax update session data

2013-02-20 Thread Anthony
The .get() method retrieves values from a dict -- you cannot use it for assignments. Anthony On Wednesday, February 20, 2013 9:10:26 AM UTC-5, 黄祥 wrote: > > a, i understand right now, thank you for detail explaination, anthony. > after now that, i still have a question > > def order_update():

[web2py] Re: ajax update session data

2013-02-20 Thread 黄祥
a, i understand right now, thank you for detail explaination, anthony. after now that, i still have a question def order_update(): id=int(request.vars.id) qty=int(request.vars.qty) session.order.get(id, 0)=qty session.order[id]=session.order.get(id, 0) return locals() why in

[web2py] Re: ajax update session data

2013-02-20 Thread Anthony
On Wednesday, February 20, 2013 1:10:32 AM UTC-5, 黄祥 wrote: > thank you so much for your hints anthony. > actually i'm still confuse about session.order.get(id, 0), on book only > have connect, secure and forget, so that i'm so lack of information what is > session can do. > session is a Storag

[web2py] Re: ajax update session data

2013-02-19 Thread 黄祥
thank you so much for your hints anthony. actually i'm still confuse about session.order.get(id, 0), on book only have connect, secure and forget, so that i'm so lack of information what is session can do. do you have any information about that? many thanks before -- --- You received this me

[web2py] Re: ajax update session data

2013-02-19 Thread Anthony
Please read the ajax() function documentation for proper usage: http://web2py.com/books/default/chapter/29/11#The-ajax-function. The ajax() function takes a URL as the first argument. Instead, you are supplying the following string: *'order_update, vars=dict(id={{=p.id}}, qty={{=qty}})'*. I ass