formio / angular

JSON powered forms for Angular
https://formio.github.io/angular-demo
MIT License
639 stars 469 forks source link

[BUG] -- FJS-1066 #591

Closed gopikrishna123 closed 8 months ago

gopikrishna123 commented 4 years ago

Environment

Please provide as many details as you can:

Steps to Reproduce

  1. When we set default values for Checkbox, Select boxes, Select and Radio components, it is not immediately reflected in Preview section of component model
  2. Outlook-3lzpbozo pastedImagebase640

In the below screenshot, I have added a checkbox and set the default value to true.But it doesn't reflect in the preview section immediately.

wag110894 commented 4 years ago

@gopikrishna123

This is by design, as the builder mode does not show configurations

gopikrishna123 commented 4 years ago

@wag110894 When we created the Radio button and selected Default value for first time, We are able to Display it in Builder Page only.

If this is by design, How are we showing the values in initial load. Kindly look into this issue and let me know if you need more information.

Edit JSON: How are we able to retain default value in JSON, Is it storing somewhere(like DB etc..) and calling the value everytime.

image

Thanks.

wag110894 commented 4 years ago

Hello @gopikrishna123,

You will see the values show up correctly on the Use Tab. This will be what is showing on initial load of the form.

The Default value is part of the form JSON so it will be stored inside of the JSON.

I hope that this helps.

Thank you.

JRiggenbach commented 4 years ago

@wag110894 Are you saying that the Preview will not reflect the default values at the time you are creating them? You also mention a "Use Tab"...are you just referring to the builder area where you drag and drop the components onto the form?

I have created a custom component (very cool that you can do such a thing), but I've been trying to get the Preview of my component to update in realtime with the default values as I enter them. I've had marginal success with this but it seems likes its a "one and done" refresh.

I can post an example application with the custom component if necessary...

Thanks.

travist commented 4 years ago

We purposefully turn off certain things within the preview, such as runtime data setting (since it is a preview). This is why the default is not populating. The reference to the "Use" tab is if you are trying this in the Form.io portal @ https://portal.form.io

JRiggenbach commented 4 years ago

@travist Thanks for the response.
Perhaps I'm going about this wrong and it's not really the default value that I'm looking for but more of a "values" section that is available on the Select Boxes component. I was just going with default values because that's where my custom component rendered with the default TextField edit form. Any idea if I add a data grid to my custom component edit form if the data grid values will be passed to my custom component? Perhaps the implicit custom option is what I'm looking for?

travist commented 4 years ago

Here is what you can add to your edit form that will resemble the Select Boxes.

https://github.com/formio/formio.js/blob/master/src/components/select/editForm/Select.edit.data.js#L4

daneformio commented 8 months ago

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