You can simply write a function that receives text fields and checks their value.
It might look like this:
function validateTextFieldValues() {
Then you can associate this function with the click of a button, for example, when creating a button:
new sap.ui.commons.Button({
In addition, TextField
has a valueState
attribute.
In connection with its liveChange
event, liveChange
is possible to check the input when entering:
new sap.ui.commons.TextField({ // your configuration liveChange: function(){ if(this.getValue() === "") this.setValueState(sap.ui.core.ValueState.Error); else this.setValueState(sap.ui.core.ValueState.Success); } });
( https://openui5.hana.ondemand.com/docs/api/symbols/sap.ui.core.ValueState.html )
source share