Anthony,
Thanks for the explanation. Went ahead and created widgets, and things
work just fine.
________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
On Wed, 15-01-2014 2:28 PM, Anthony wrote:
On Wednesday, January 15, 2014 3:47:28 AM UTC-5, Kiran Subbaraman wrote:
Hmm, I was planning to use keepvalues for the following scenarios:
* Scenario1 - submitted form returns with errors, and still
displays the form with the submitted values
* Scenario2 - submit form successfully, and still display the
form with the submitted values
You mention that the keepvalues should work fine for Scenario2.
No, I was just saying that keepvalues is only intended for Scenario2
-- it is irrelevant for Scenario1 (in that cases, the values are
retained regardless of keepvalues). Neither scenario works for you
because you are not using form.custom.widget.
Can you please elaborate how I can do this "so your custom widget
should be able to retain the value if desired (without using
request.vars)".
Look at the documentation on custom widgets. Your widget function will
receive a field object and a value. Just take the value and use it as
the "value" attribute of your input element in the widget code.
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.