I finally got this to work.

Basically, the requires field was not getting passed to the INPUT helper,
since I was using **attributes instead of **attr.

Passing field.requires to the INPUT helper, it works :)

-Thadeus




On Tue, Nov 17, 2009 at 12:08 AM, Thadeus Burgess <[email protected]>wrote:

> I can't get my custom checkboxes widget to parse the data like |1|3|45|
> that is the problem.
>
> It displays correctly, and the SQLFORM will accept it, but it stores it
> wrong.
>
> -Thadeus
>
>
>
>
>
> On Mon, Nov 16, 2009 at 11:38 PM, mdipierro <[email protected]>wrote:
>
>>
>> Multiple stores data as '|1|3|45|' because this is easy to parse
>> unambiguously using like '%|3|%'.
>>
>> On Nov 16, 9:27 pm, Thadeus Burgess <[email protected]> wrote:
>> > What is special about the SQLFORM.widgets.checkboxes.widget that makes
>> > web2py process the data into a string of pipe separated integers?
>> > multiple=True
>> >
>> > It seems in my custom implementation of a checkboxes widget, will allow
>> you
>> > to post multiple, however it stores the data as the actual list.
>> >
>> > I am trying to do a custom checkboxes that are displayed in a
>> hierarchical
>> > tree. The checkboxes display correctly, but SQLFORM saves it wrong.
>> Widget
>> > code in 0_plugin_categories.py
>> >
>> > Code:http://static.thadeusb.com/web2py.app.welcome.w2p
>> >
>> > Below, the first two are the SQLFORM widget, and the last three is
>> testing
>> > with my custom widget.
>> >
>> > test.id <
>> http://127.0.0.1:8000/welcome/appadmin/select/db?orderby=test.id>
>> > test.name<
>> http://127.0.0.1:8000/welcome/appadmin/select/db?orderby=test.name>
>> > test.categories<
>> http://127.0.0.1:8000/welcome/appadmin/select/db?orderby=test.categories>
>> > 1 <http://127.0.0.1:8000/welcome/appadmin/update/db/test/1>
>> > asdf|7|9|2<http://127.0.0.1:8000/welcome/appadmin/update/db/test/2>
>> > asdf2|6|11|12|5|3 <
>> http://127.0.0.1:8000/welcome/appadmin/update/db/test/3>
>> > ['3', '4', '6']4 <
>> http://127.0.0.1:8000/welcome/appadmin/update/db/test/4>
>> > ['2', '8', '12'] 5 <
>> http://127.0.0.1:8000/welcome/appadmin/update/db/test/5>
>> > ['1', '2', '8...
>> >
>> > -Thadeus
>> >>
>>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to