I can't give you an example, but I can tell you that I managed to use collective.z3cform.datagridfield in a Plone 5.2 setup. The same code did not work on Plone 5.1.
This was done as a test when I updated some add-ons to Python 3, so I dont have the code
As far as I remember I defined the 'value_type' in an add-on and then used that in easyform.
This is what I think I did :
In my add-on (interfaces.py):
class IMySchema(interface.Interface):
something = schema.TextLine(title=u"Something")
something_else = schema.TextLine(title=u"Something Else")
Now I can add repeatable fields to the form. But the inserted values are not show on thanks page and not send via email. There is just "<NO_VALUE>" shown.
Please just submit a patch to the existing actions if they don't support lists. You might need to make changes to both the email adapter and the save data adapter and to the thank you page. Creating new plugins just creates confusion.
Please just submit a patch to the existing actions if they don't support lists.
Well - that`s not so easy. We (@zopyz and I) were not able to find the reason why "<NO_VALUE>" is set. While debugging widget_value seems to be set correctly at z3c.form.widget but thanks page shows "<NO_VALUE>"
I did a quick test with the save adapter, and it looks like the fields are saved, but not correctly. (I used an existing model.schema definition, maybe that has something to do with it).
class IMySchema(model.Schema):
"""example fields to be used with easyform and fragments"""
something = schema.TextLine(title=u"Something")
something_else = schema.TextLine(title=u"Something Else")´
Anyway:
I added it to easyform
I deleted the mail adapter and added a save adapter
It looks to me that 'the form at my screenshot' is not using the data grid-widget, but a 'multi-widget'. I am not sure if this is related to the thanks page and mailer