Optional ValidationGroup child-field setting override
See original GitHub issueCurrently, as of Cx v20.7.1 form fields can override the ValidationGroup settings, e.g. if a ValidationGroup is disabled, the same setting on a respective field, being more specific, overrides it (commit id: c2adf44c9de). In previous versions of Cx it was the other way around, ValidationGroup settings would take precedence over respective field settings within it.
Since both behaviors have valid use-cases, it would be good if the developer could decide which one is more appropriate, via a custom flag, e.g. overrideFieldSettings={true/false}
or something in that sense.
The implementation could rely on the optional use of the coalesce
function, based on the flag value.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Can I override fields from a Pydantic parent model to make ...
Overriding fields is possible and easy. (Somebody mentioned it is not possible to override required fields to optional, but I do not agree)....
Read more >Specifying Validation Groups - Microsoft Learn
You create a validation group by setting the ValidationGroup property to the same name (a string) for all the controls you want to...
Read more >How to have an “optional” field but if present required ... - GitHub
One is to allow BaseModel 's to have a special configuration option that ... Like @acnebs, I don't override the whole object, I...
Read more >5.5. Input Validation - terasoluna.org
Override the message for age field using the below settings. application-messages.properties. # override messages NotNull.userForm.age="{0} ...
Read more >Conditionally Requiring a Form Field in Symfony2
In this case, the state field isn't built initially: it waits until the form data is set and then is built based off...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Strict mode would work in that way that if
disabled
is evaluated totrue
onValidationGroup
it would force all children to be disabled. If the value isfalse
, fields can decide for themselves.The opposite (more common) use-case is that in the non-strict mode the field should able to be enabled by setting
disabled
tofalse
, ignoring the parent settings, i.e. if one field is an exception.Published in cx@20.8.0.