I've created a custom form item using CanvasItem. If I give it a defaultValue, how can I make sure that a call to the form's getValues() already includes that item's default value?
Announcement
Collapse
No announcement yet.
X
-
We're not really clear on the question. Please see the CanvasItem docs. If shouldSaveValue is set, and if you set a defaultValue, you should expect a showValue() call on initialization. There is nothing that you need to do to cause the value to be included in getValues().
-
I try to explain briefly:
I've created a MenuButton as CanvasItem (like the "Font" en "Size" dropdowns in this editor). It's menu contains one embedded component, being a DynamicForm with several check boxes. The menu button itself has name "others". Using "shouldSaveValue" causes a nested value like "others": { "check1": false, "check2": true }.
Maybe this approach is not the best, so any ideas are appreciated.
Comment
Comment