formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

bug with custom submission.data & container & columns component

Open amirmf opened this issue 8 years ago • 3 comments

i'm trying to inject default values to form(which has container component in it):

    Formio.createForm(document.getElementById('${formId}'), _scope${formId}.formSchema, _scope${formId}.formOptions).then(function (form) {
            form.submission= {data:{containerfeild:{field1:1111}}};

but the value won't show in the form

amirmf avatar Aug 10 '18 09:08 amirmf

i did a few test on the form ....it's only happening when you use container. i use container component in my form and also try to set form.submission on rendering when form loaded sussesfully any change i make in form using data entry won't effect the submission object.

i think when i set custom data to form.submission on rendering, the submission object kind of loss the connection to container field value object

amirmf avatar Aug 10 '18 09:08 amirmf

sample-form

use this sample form for debugging.... i have custom button with a debugger in it.

i think this is happening only when you have a layout component(columns/fieldset) in container. in my sample-form you can see the "t1" field works fine but you don't have the data of "t2" & "t3" which are in column component.

  • you should set form.submission= {data:{}}; after form creation

amirmf avatar Aug 10 '18 22:08 amirmf

Could you try using the latest 4x renderer?

If the issue persists please feel free to open a new issue.

jeriah-formio avatar Sep 26 '19 19:09 jeriah-formio