Skip to content
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

Values not being saved when using select2 widget inside of DataGridField. #38

Open
andreesg opened this issue Sep 14, 2015 · 1 comment

Comments

@andreesg
Copy link

When using RelatedItemsWidget or AjaxSelectWidget inside of a DataGridField the values added to a new row are not saved. Values from other subfields (TextLine for example) are saved.

The issue can be reproduced using the following dependencies:

plone.app.widgets = 1.x
collective.z3cform.datagridfield = 1.1

Steps to reproduce:

Install collective.z3cform.datagridfield and create a content type using this as a datagrid field:

category = ListField(title=_(u’Category')
        value_type=DictRow(title=_(u'Category'), schema=ICategory),
        required=False)
form.widget(category=DataGridFieldFactory)

Create the interface schema:

class ICategory(form.Schema):
    form.widget('name', AjaxSelectFieldWidget, vocabulary=“your.product.vocabulary")
    name = schema.List(
        title=_(u'Category'),
        required=False,
        value_type=schema.TextLine(),
        missing_value=[]
    )
    notes = schema.Text(title=_(Notes'), required=False)

I noticed that the values are getting empty to the GridDataConverter.
The extract function from DataGridFieldObject also returns the new rows with empty values for the subfields that are using the select2 widgets.

@jensens
Copy link
Member

jensens commented Mar 19, 2017

I added some changes to fix the date picker widget. Those might fix also problems with other patternslib based widgets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants