angular icon indicating copy to clipboard operation
angular copied to clipboard

[Custom Components] Form Rendering issues

Open Mkaith opened this issue 4 years ago • 4 comments

Hi team, I have successfully captured the value and the array is stored in db but when i try to get the submission, my appropriate selection is not selected. For Ex:- While Submitting :- image

image

Data Retried while rendering:- image

Rendered Output:- image

Thanks in advance.

Mkaith avatar Aug 07 '21 11:08 Mkaith

Hello @Mkaith, can you provide your form json?

wag110894 avatar Aug 09 '21 13:08 wag110894

Here is the Json of form @wag110894 { "components": [ { "label": "Weekdays", "optionsLabelPosition": "right", "inline": false, "tableView": false, "validate": { "onlyAvailableItems": false }, "key": "dfgh", "type": "weekdaypicker", "input": true }, { "type": "button", "label": "Submit", "key": "submit", "disableOnInvalid": true, "input": true, "tableView": false } ] }

I have found the reason why it cant be rendered :-

  1. We are making a custom component with some checkboxes(Weekdays).
  2. We capture there selection through some functions and populate an array.
  3. Pass this array to valuechange event which update the submission data.
  4. This flow is correct.
  5. But when we try to populate the form through submission it fails as it require a key but we havent provided any key to it and we even cant provide that in this way.
  6. I further debugged the check matrix example and found that submission flow was broken there also. There even on submitting the form the data is not captured.
  7. I am now trying with the default values.
  8. But pls help if you have any ideas how to do it.

Thanks

Mkaith avatar Aug 10 '21 05:08 Mkaith

Have you taken a look at https://formio.github.io/formio.js/app/examples/customcomponent.html or https://github.com/formio/angular/wiki/Custom-Components-with-Angular-Elements?

wag110894 avatar Aug 10 '21 14:08 wag110894

@wag110894 I have read both these documentations and came to such conclusion.

I have thought of a other way round to make a table and drag check box components to each column to represent weekdays. But I still need help on submission flow I.e. to render the submitted form.

Mkaith avatar Aug 10 '21 14:08 Mkaith

Closing this thread as it is outdated. Please re-open if it is still relevant. Thank you for your contribution!

jeriah-formio avatar Jan 31 '24 14:01 jeriah-formio