Ya its must working with type='list:string' On Friday, 3 April 2015 01:55:49 UTC+5:30, Teemu wrote: > > Hi, > > I do not know if this is bug or not but I am not able to get multiselect > widgets to work properly. I have this kind of lines in my table definition: > > Field('methodsA', type='string', > requires=IS_IN_SET(['method1','method2','method3'], multiple=True, > zero='<-- choose -->'), widget=SQLFORM.widgets.multiple.widget) > Field('methodsB, type='string', > requires=IS_IN_SET(['method1','method2','method3'], multiple=True, > zero='<-- choose -->'), widget=SQLFORM.widgets.checkboxes.widget) > > These correctly translate into select and multiple checkbox widgets both > in my app and admin interface. They also correctly stores my multiple > selections into the database (in form |method1|method2| etc.). However if I > try to modify records later on the edit form does not show previously > selected and stored selections. In form view it looks like previous > selections were empty set! And if I submit the form without selecting > proper list items again the form will store empty set into the database. > > I made numerous google searched and found suggestion how this should be > fixed: http://git.net/web2py/msg108396.html. The suggestion applies only > to SQLFORM.widgets.multiple.widget and this small change hasn't been > integrated into web2py source tree yet. Does this small change break > something? This small change seems to fix selection issues in form view. Do > I use gluon.sqlhtml.MultipleOptionsWidget incorrectly or is this real bug? > If I am using this widget inappropriately could someone show me how this > widget should be used. I am also curious to know how > SQLFORM.widgets.checkboxes.widget should be fixed to make it work correctly. > > I am using web2py version: 2.9.12-stable+timestamp.2015.03.19.06.51.11 on > linux. > > Teemu > > >
-- 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/d/optout.