Module plone.formwidget.autocomplete.widget, line 63, in __call__ AttributeError: 'SimpleVocabulary' object has no attribute 'search'

Some weeks ago I faced the same issue, and found in a github issue (sorry I did not save the URL, and I couldn't find it again), that the documentation there is wrong and the recommended way is to use the AjaxSelectWidget.

I rewrote our code like this:

    from plone.app.z3cform.widget import AjaxSelectFieldWidget
    ...        
        cycle = Tuple(
            title=_(u'The name of the cycle this event is part of'),
            description=_(u'Enter a text, and an autocomplete attempt will be made'),
            required=False,
            value_type=TextLine(),
            missing_value=(),
        )
        directives.widget(
            'cycle',
            AjaxSelectFieldWidget,
            vocabulary='auditorio.types.vocabularies.cycles'
2 Likes