You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems to me that the References page (docs/advanced/references.rst) is not up to date for Plone 5. I have two reasons for this:
I have not been able to get the ObjPathSourceBinder to work in any way. If I pass the RelationChoice field a vocabulary=plone.app.vocabularies.Catalog, all is fine. But I want to filter the vocabularies by any criteria, and the only way I know is to use a (Path | ObjPath | UUID)SourceBinder from plone.formwidget.contenttree, and no matter what I try, I always get an empty list of values to select from.
The RelatedItems behavior in Plone 5 uses a RelatedItemsFieldWidget, which is not mentioned anywhere on that page. Instead, it talks about the AutocompleteFieldWidget, which I'm not sure is still good for Plone 5.
Here is the code for the IRelatedItems behavior, from plone.app.relationfield.behavior version 1.3.2, to illustrate my two points above:
class IRelatedItems(model.Schema):
"""Behavior interface to make a Dexterity type support related items.
"""
relatedItems = RelationList(
title=_(u'label_related_items', default=u'Related Items'),
default=[],
value_type=RelationChoice(
title=u"Related",
vocabulary="plone.app.vocabularies.Catalog"
),
required=False
)
form.widget('relatedItems', RelatedItemsFieldWidget,
vocabulary='plone.app.vocabularies.Catalog')
fieldset = Fieldset('categorization',
label=_(u'Categorization'), fields=['relatedItems'])
IRelatedItems.setTaggedValue(FIELDSETS_KEY, [fieldset])
alsoProvides(IRelatedItems, IFormFieldProvider)
What is the new way to do what used to be done with SourceBinders?
The text was updated successfully, but these errors were encountered:
That example is just a simple Choice though rather than a RelationChoice (i.e. it only stores a UID rather than a RelationValue indexed in the relation catalog) so I'm not sure if it will work the same.
Now, does that mean that the *SourceBinders are no longer supported in Plone 5? A related question would be whether plone.formwidget.contenttree is even used anymore, given mockup.
I'm just trying to understand how this docs page should be updated.
It seems to me that the References page (
docs/advanced/references.rst
) is not up to date for Plone 5. I have two reasons for this:ObjPathSourceBinder
to work in any way. If I pass theRelationChoice
field avocabulary=plone.app.vocabularies.Catalog
, all is fine. But I want to filter the vocabularies by any criteria, and the only way I know is to use a(Path | ObjPath | UUID)SourceBinder
fromplone.formwidget.contenttree
, and no matter what I try, I always get an empty list of values to select from.RelatedItemsFieldWidget
, which is not mentioned anywhere on that page. Instead, it talks about theAutocompleteFieldWidget
, which I'm not sure is still good for Plone 5.Here is the code for the
IRelatedItems
behavior, fromplone.app.relationfield.behavior
version 1.3.2, to illustrate my two points above:What is the new way to do what used to be done with
SourceBinder
s?The text was updated successfully, but these errors were encountered: