Hello,
I’m trying to use a custom editor to show/edit all components arrays combined.
I’m not sure whether this is a bug or it’s just not supported but any help would be much appreciated!
Current behavior
Created a component “c1” with one field only (String-TextArea).
Created a schema “s1” and added Components field (the array) to it, and edited the schemas input on the validation tab to be “c1”.
Added an item based on “s1” schema, I can see my empty components array and “Add Component” button. I’ve added 2 items to the Components array (e.g. “MyString1” and “MyString2”).
If you navigated back to the content to check the new editor, you will be able to see it and see our 2 items as [object Object],[object Object] which is fine (I’ve created my own editor and displayed MyString1,MyString2), but you will see an error in the console ERROR TypeError: e.registerOnChange is not a function (First error).
The second issue is, if I manually added a 3rd item to the editor (so the editor will have this: MyString1,MyString2,MyString3) and called field.valueChanged(newValue); I get an error Error: cannot find form control at index because the new item wasn’t added by using the original Add Component button as it doesn’t exist any more after using the custom editor. Is there a way using the sdk to programmatically call the function that is called when we click on Add Component button in order to create controls for the new items and add them to the controls array?
I’ve tried to add the new items to the components array, but obviously it didn’t add the controls.
e.g. newValue.Components.iv.push({Body: "MyString3", schemaId: '2395deb8-3587-4f24-8c12-e9339e7b3abc'})
and I got this error
Hi Sebastian,
Thanks very much for working on this.
I’ve tried squidex/squidex:dev-6491 but unfortunately it is still not working.
When the custom editor loads, I’m getting the same old error:
If I tried to add a new value and call field.valueChanged(newValue); I get the following error:
Sorry Sebastian, will this be merged to master soon? (e.g. in order to be able to use the latest docker tag).
Also I can’t find the code changes branch which dev-6509 is based on, would you mind sharing it please? Thanks in advance.