Denes, > form_factory already gives you the dropbox using the OptionsWidget. > Do you want something different?.
No, I would like to use the OptionWidget. I had a look at the OptionsWidget class in gluon/sqlhtml file, but wasn't able to figure out how to use it in a function. form=form_factory(SQLField('sleutelwoord',requires=IS_NOT_EMPTY(),\ widget=lambda self, value:INPUT (_id="='bykeyword',_name='sleutelwoord',_class='OptionsWidget', ...))) > form=form_factory( > SQLField( 'sleutelwoord',requires=IS_IN_DB(...) ) > ,labels={'sleutelwoord','Selecteer een sleutelwoord'} > ) > > But if you want distinct=True then you have to use IS_IN_SET as in > your original post. I had hoped I could resolve this in a handler, like I did for the auto- complete field. > BTW, instead of: > keywordlist=[keywordrows[i]['sleutelwoord'] for i in range(len(keywordrows))] > > you can do: > keywordlist=[k['sleutelwoord'] for k in keywordrows] That's a lot better than my line of code, when I don't get the widget to work, I'll do it this way. Annet. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---