json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

Changes in dynamic options of select type input are not reflected in the UI #940

Closed yourarj closed 6 years ago

yourarj commented 6 years ago

Expected behaviour

I expected that if I give titlemap and enum values as object and array resp. (Dynamic values) for a select type field, the changes made in the source variables should get reflected in the options visible for selection

Actual behaviour

It actually doesn't reflect changes

Gist/Plunker/Demo

form was intitialized as <form name="questionnaireForm" sf-schema="qc.schema" sf-form="qc.form" sf-model="qc.model"></form>

select type was initialized as

snippet from schema obj

fieldset: { title: "Field Set for question", type: "string", enum: qc.fieldSets, placeholder:"Kindly select a fieldset to which the question will belong", default:NO_FIELDSET } if you notice enum source is an array where var qc.fieldSets = ["No Fieldset", "gropu one" ];

snippet from form obj

fieldset:{ key:"fieldset", type:"select", titleMap: fieldSetTitleMap } here titleMap is an object fieldSetTitleMap

where var fieldSetTitleMap = { "No Fieldset" : "No Fieldset", "gropu one" : "group one" }

but when I make changes in the fieldSetTitleMap, qc.fieldSets, if I try debugging, changes are there in schema and form object but they don't get reflected in the rendered question

Kinldy see the sceenshots below for better understanding 2017-11-16 12_56_57-developer tools - doctor ehr _ login page - http___localhost_8080_ _questionnair form object screenshot after changes

2017-11-16 12_57_36-developer tools - doctor ehr _ login page - http___localhost_8080_ _questionnair schema object screenshot after changes

2017-11-16 12_54_19- Existing question options not updated

If you have any query kinldy let me know. @json-schema-form/angular-schema-form-lead