Try:
form.widget('tags', SelectWidget, multiple='multiple', size=5)

(requires plone.autoform >= 1.4)

David

On 2/20/14, 1:47 AM, Andreas Jung wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, still getting the In-Out widget.
What is the correct widget for rendering a

<select multiple="multiple"> widget?

I tried CollectionelectFieldWidget but this also render the in-out widget.

Andreas

Asko Soukka wrote:
The correct class in this context is OrderedSelectFieldWidget

-Asko

ajung wrote:
Hi there,

I fight with adding a multi select widget to schema.List() field
(instead of using the default In-Out widget here). Am I missing
something?

-aj


from z3c.form.browser.orderedselect import OrderedSelectWidget

class ITestFolder(model.Schema):

form.widget(tags=OrderedSelectWidget) tags = schema.List(
title=_(u'label_tags'), value_type=schema.Choice(title=u'Tags',
source=VocabularyBinder('test_tags')))


Traceback (innermost last): Module ZPublisher.Publish, line 138, in
publish Module ZPublisher.mapply, line 77, in mapply Module
ZPublisher.Publish, line 48, in call_object Module
plone.autoform.view, line 47, in __call__ Module
plone.autoform.view, line 57, in _update Module z3c.form.form, line
134, in updateWidgets Module z3c.form.field, line 254, in update
TypeError: __init__() takes exactly 2 arguments (3 given)




-- View this message in context:
http://plone.293351.n2.nabble.com/Multi-select-widget-for-schema-List-in-a-Dexterity-schema-tp7570234.html



Sent from the Product Developers mailing list archive at Nabble.com.
_______________________________________________ Product-Developers
mailing list [email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

- -- Regards
Andreas Jung
[email protected]
about.me/andreasjung

EuroPython 2014 Organization Team - Communications

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJTBc8vAAoJEADcfz7u4AZjilALwJegn+Hc6kMqRYho3vj56gmB
YrcwH0f/7P+l+ZY4hnNFFx9y6HAYlnqogDm0A+TEfhkoHdombZ+NPEgIP/X2Uuau
rn4Da7KNR4GbT99rFkP2yR5JfjWQ5q3OVyi7NE90Ih2txqoPPxFvtksnQlPnYGsM
OWxgM8qZ9M+ibvoukYD/dcVsqK9rHQp0ra/DkCJ5ScmP13xymVhawpKw9Cr/bwCr
FI4tdLz5hEtkhJ2CACMMbLdU+RqGiOQF9Z8nOCMbLPo3910BPenJnpxa5un++Tn+
mU15G6/CiVCqhjHT7Cy556nmN+9YJUB4LX5UnnHDWLHwttROj/ExdEaSDYijq+HY
xVArA8bM7GnsUdf6VH+L5/wD5fGMow4qL4BEt5BiulFlsU15yMFT6YeSH+SbJvpr
MylvgzYg4Yvkfn+QunmCMbJfBcEFD/xljHR7gTH5Iem/Wb8rZpcee13GaDGZWFTI
+8WjRoAhBcWi9+eqzqsaGZXBsRSJBQM=
=hF7p
-----END PGP SIGNATURE-----
_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

_______________________________________________
Product-Developers mailing list
[email protected]
https://lists.plone.org/mailman/listinfo/plone-product-developers

Reply via email to