multiple select plugin and list reference

90 views
Skip to first unread message

BlueShadow

unread,
Nov 27, 2013, 11:14:25 AM11/27/13
to web...@googlegroups.com
I found this wonderfull plugin: http://dev.s-cubism.com/plugin_multiselect_widget
which looks awesome for the things I wonna do.
But I don't get ist to work with a field which has a list reference table
I want the field to be either empty of filled with an unlimeted amount of entries. So I had no required field at all:
Field('Fruit','list:reference Fruits'),
so I tried the following:
from plugin_multiselect_widget import (
    hmultiselect_widget
, vmultiselect_widget,
    rhmultiselect_widget
, rvmultiselect_widget,
)
...
db
.Cocktail.Fruit.requires=IS_EMPTY_OR(IS_IN_DB(db,'Fruits.id','Fruits.Name',multiple=True))
db
.Cocktail.Fruit.widget = hmultiselect_widget
which gave me the multiselect widget but When I mark a fruit and click on the register button nothing happens.


Dennis Jacobs

unread,
Nov 24, 2014, 9:53:01 AM11/24/14
to web...@googlegroups.com
Hi TSmith,

I'm experiencing the exact same issue! Were you able to resolve this issue?
And if so, how exactly did you do so?

Regards,
Dennis.

Kevin Bethke

unread,
Nov 25, 2014, 7:18:46 AM11/25/14
to web...@googlegroups.com

I haven't fixed the issue jet.
Regards

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/_wpkQivld-Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Leonel Câmara

unread,
Nov 25, 2014, 12:55:48 PM11/25/14
to web...@googlegroups.com
This is working fine for me.

db.define_table('fruit',
   
Field('name'),
)


db
.define_table('cocktail',
   
Field('fruit','list:reference fruit'),
)



from plugin_multiselect_widget import (
    hmultiselect_widget
, vmultiselect_widget,
    rhmultiselect_widget
, rvmultiselect_widget,
)



db
.cocktail.fruit.requires=IS_EMPTY_OR(IS_IN_DB(db,'fruit.id','%(name)s',multiple=True))
db
.cocktail.fruit.widget = hmultiselect_widget

I just put that in the models with the plugin in the modules folder, then I inserted some fruit and cocktails in appadmin. Everything worked correctly. This is basically the same thing you're doing right?  
  
Can you open the console and check for javascript errors?


Kevin Bethke

unread,
Nov 28, 2014, 5:55:10 AM11/28/14
to web...@googlegroups.com
apparently I did something diffrent back than. Now its working.
Thanks

Kevin Bethke

unread,
Nov 28, 2014, 6:13:08 AM11/28/14
to web...@googlegroups.com
I think I was a little quick to write it works. The multiple select shows but the entries won't move to the second box. So no function of the widget at all.
How do I open up the console to check for javascript errors?

Johann Spies

unread,
Dec 1, 2014, 1:37:21 AM12/1/14
to web...@googlegroups.com
On 28 November 2014 at 13:13, Kevin Bethke <kevin....@gmail.com> wrote:

How do I open up the console to check for javascript errors?


If you use Firefox, open Firebug (you may have to install it) in the developer menu.  Chrome also have a menu item for developer tools and so Opera.

Regards
Johann

--
Because experiencing your loyal love is better than life itself,
my lips will praise you.  (Psalm 63:3)
Reply all
Reply to author
Forward
0 new messages