-
Notifications
You must be signed in to change notification settings - Fork 649
Global options does not propagate properly #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Any fix? |
Nope not yet. mån 2 mars 2015 kl 12:16 skrev Aliaksandr Pshanichnik <
|
Would I be correct in assuming that this affects all global options, in particular readonly? E.g. I'm having trouble getting the following to work, i.e. the entire form is still editable: <div sf-model="..." sf-form="..." sf-schema="..." sf-options="{ formDefaults: { readonly: true } }"></div> |
Created small pull request (#396) that fixes my issue for the initial form rendering. However, if the model/schema is changed, any updates to the global options aren't realized in the newly rendered form: e.g. if I display one model as readonly then try to show another in the same form as not readonly, it will still not be editable. |
@golfmat1 is that after a |
I'm not sure. I tried to broadcast that event and still had the issue However, I'm relatively new to angular and working within a framework in which there are numerous things I could be doing wrong. So it's perfectly possible that I wasn't triggering it correctly. I created a workaround for now using schemaFormProvider.postProcess to explicitly set readonly on all form elements. This works, though it is probably not ideal. |
@golfmat1 I'm asking since you need to either change the entire form (or schema) instance, otherwise you need the event, and its easy to forget :) |
any update on this one? having the same problem described in other threads, formDefaults validationMessage applied to top-level items, but not into sub-sections |
I am having the same problem here. I try to toggle the form between read-only and edit but it does not update the form state.
|
Any update on this issue? |
@cmartin81 #396 was merged and released in v0.8.3. I can confirm that fix solved the issue for me (trying to set |
The problem was that initialForm was used to generate a form on redraw event, but when it was an object type, it was modified in-place by rendering function. So, when the next redraw event happened, initialForm already had the properties defined, and it prevented the default values from being populated into them.
I am having the same issue as @jmaister , and I am able to reproduce with the latest version (v0.8.12) as of now. Here's a minimal code. It works on the first click, but it fails after that. PR is here #644 .
|
The problem was that initialForm was used to generate a form on redraw event, but when it was an object type, it was modified in-place by rendering function. So, when the next redraw event happened, initialForm already had the properties defined, and it prevented the default values from being populated into them.
The problem was that initialForm was used to generate a form on redraw event, but when it was an object type, it was modified in-place by rendering function. So, when the next redraw event happened, initialForm already had the properties defined, and it prevented the default values from being populated into them.
Fix for #121 to redraw with proper defaults
See #29 (comment)
The text was updated successfully, but these errors were encountered: