(de-)select values for the multiselect_widget from ScubismLabs.

22 views
Skip to first unread message

Dennis Jacobs

unread,
Nov 21, 2014, 4:29:29 AM11/21/14
to web...@googlegroups.com, dennis...@technicolor.com, dja...@jadeitgcv.be

Hi Kenji,

First of all I wanted to thank you for submitting and maintaining your web2py plugins.
However I do have one small issue with the “multiselect_widget”, which could be due to the fact that I don’t know how to implement the plugin properly.

 

The problem I’m currently facing is the fact that I don’t know how to preselect values.

For instance, I’m trying to create a page where a user’s membership can be rectified.
The administrator first have to select a username (based on a dropdown from), afterwards the 2 boxes(“member of” and “Not member of”) should display the memberships of that specific user.

And this is the point where I’m stuck.
All the groups seem to end up in the same box, and I can’t figure out how to make the selection of “members” and “nomembers”.

And I just wanted to know that I’m not doing something wrong, and I’m not forgetting something.

The line I currently have to create this widget is the following.

form = SQLFORM.factory(Field("Members", type='list:reference(db.auth_group.role)', requires=IS_IN_SET(grouplist,multiple=True), widget =rhmultiselect_widget))

Dennis Jacobs

unread,
Nov 25, 2014, 4:01:19 AM11/25/14
to web...@googlegroups.com
This topic can be closed.
Instead of using the sqlform.factory()-statement, you can just set db.table.field.widget = multiselect_widget.
To activate the widget for this field.
Reply all
Reply to author
Forward
0 new messages