-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
relationchoice not working ... #67
Comments
If you want to make use of the related items widget, I'd try not to use a CatalogSource but the following: # -*- coding: utf-8 -*-
from collective.z3cform.datagridfield import DataGridFieldFactory
from collective.z3cform.datagridfield import DictRow
from plone.app.z3cform.widget import RelatedItemsFieldWidget
from plone.autoform import directives
from plone.supermodel import model
from z3c.relationfield.schema import RelationChoice
from zope import schema
from zope.interface import Interface
class IEventRow(Interface):
note = schema.TextLine(
title=u'Note',
required=True,
default=u'',
)
directives.widget(
'events',
RelatedItemsFieldWidget,
pattern_options={
'selectableTypes': ['Event'],
}
)
events = RelationChoice(
title=u'Event',
vocabulary='plone.app.vocabularies.Catalog',
required=True,
)
class IEventsGroup(model.Schema):
directives.widget(employees=DataGridFieldFactory)
employees = schema.List(
title=u'A list of events with notes.',
required=False,
value_type=DictRow(
title=u'Event',
schema=IEventRow,
)
) |
i will give that a try! thx @thet |
|
@pbauer sadly: no. even after hours of desperation and agony ;) i guess this is broken by concept as complex fields using i'd say: YAFOWIL as @rnixx and @jensens are working on that and more and more fields/widgets/forms and types start looking good and useable. this will allow all sorts of complex fields (compounds) and sorting works like a charm (better than z3c.form) and no change in how to write behaviors, forms, ... |
Fixed by #150 👍 |
IEventsGroup is a globally addable contenttype.
the widget gets displayed, but when clicking in the relationchoice widget i get a spinner and no result. calling the view "getSource" i get {"error": "Vocabulary lookup not allowed."}
this seems to occur as self.context.context has NO_VALUE
any help?
The text was updated successfully, but these errors were encountered: