Trigger validation constraints for empty value
See original GitHub issueOpenUI5 version: all
Browser/version (+device/version): all
URL (minimal example if possible): https://plnkr.co/edit/l6XtmBXqOtlNFBuK2CtA?p=preview
What is the expected result? There is no way to check all constraints for all/one control in a view. The “hack” to get and set the current value doesn’t work for empty input fields.
What happens instead? noting for empty input fields
Request:
Provide a simple api to check a constraints for a list of controls and return a single true/false value:
this.getView().validateControls(['inputA','inputB','inputC'])
Or trigger it at least for strings with a length of 0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
trigger to validate empty fields - Salesforce Developers
I'm trying to write a trigger to make sure certain fields are not empty based on the status that is chosen. I have...
Read more >Empty input value does not triggger @NotNull but it triggers ...
i have this entity: import javax.validation.constraints.NotNull; import org.hibernate.validator ...
Read more >Java Bean Validation Basics - Baeldung
@NotEmpty validates that the property is not null or empty; can be applied to String, Collection, Map or Array values. @NotBlank can be...
Read more >Constraint validation - HTML: HyperText Markup Language
Complex constraints using the Constraint Validation API setCustomValidity() to set the result of the validation: an empty string means the ...
Read more >Chapter 3. Declaring and validating method constraints
Depending on the interception facility you use for triggering method ... an executable with return value but no parameters (the constraint applies to...
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
I can’t see the point in copying valdiator.js into every ui5 app.
Form with a mandatory input field can’t use the default validation without a huge junk of custom code. That’s odd and should be changed. And it can’t be done in a elegant way, because validation isn`t triggered for empty fields.
Hi, During data binding a check for empty input fields only happens if it was changed.
As you have already done in the “Validator.js”, you can validate a empty property by fetching the binding: https://openui5.hana.ondemand.com/#/sample/sap.m.sample.InputChecked/code/C.controller.js
Unfortunately there are no plans to implement a generic solution to validate multiple (empty) controls.
Best regards, Sven