in archetypes-based content types if vocabulary used on choice field has less number of items (5, iirc) widget used radio button input instead of select list.
in dexterity-based content types there's no such behavior , select list used.
is there way force radio button input?
i tested following not working , can't find documentation available:
from z3c.form.browser.radio import radiowidget class imytype(form.schema): form.widget(my_field=radiowidget) my_field = schema.choice( title=_('my field'), vocabulary=my_choices, required=true, )
i'm using plone 4.2 , plone.autoform 1.3.
you can specify custom widget in plone.autoform 1.4 , above.
in earlier versions of plone.autoform need specify "field widget" (a callable produces widget when called) instead of widget class. (plone.autoform 1.4 supports either one, , other things covered in documentation.) in case use z3c.form.browser.radio.radiofieldwidget.
Comments
Post a Comment