When you pass a record to SQLFORM, it retains the changed values by passing the values in request.post_vars to the respective field widgets. Can't say what's going on in your case without the code.
Anthony On Thursday, February 18, 2016 at 4:13:23 PM UTC-5, Ian W. Scott wrote: > > The code is very extensive (it's a complex widget) so first I'm just > trying to understand what happens in a normal form. You say that other > widgets aren't preserving values from the db. So where do the values come > from if you have keepvalues=True? > > Also, this *is* a situation where an existing record is loaded into the > form, then modified on form submission. So how does the form present to me > the values I just changed if it's not coming from the db? I think if I can > understand how that works I'll be able to solve the problem in my code > myself. > > Thanks, > > Ian > > On Thursday, February 18, 2016 at 4:06:06 PM UTC-5, Anthony wrote: >> >> On Thursday, February 18, 2016 at 3:54:43 PM UTC-5, Ian W. Scott wrote: >>> >>> Okay, that explains the behaviour. How, then, are values usually >>> preserved on an ajax form for the built-in widgets? When I submit the form >>> all of the other fields (not using my widget) preserve the newly submitted >>> values. >>> >> >> Again, hard to say what's going on in your case without seeing any code, >> but the other widgets are not presenting values from the database (unless a >> pre-existing record has been loaded). >> >> Anthony >> > -- 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.

