-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Sometimes i only want to validate required fields... that maybe they don't have a Type, for example with ComboBox controls.
I make a simple change on validation to control this situation
Hope you like it,.
if (oControl.getBinding(aValidateProperties[i])) {
///original code
}else if (oControl.getRequired && oControl.getRequired()===true) {
oControlBinding = oControl.getBinding(aValidateProperties[i]);
oExternalValue = oControl.getProperty(aValidateProperties[i]);
if (!oExternalValue || oExternalValue==="") {
this._isValid = false;
sap.ui.getCore().getMessageManager().addMessages(
new Message({
message: "",
type: MessageType.Error,
target : ( oControlBinding.getContext() ? oControlBinding.getContext().getPath() + "/" : "") +
oControlBinding.getPath(),
processor: oControl.getBinding(aValidateProperties[i]).getModel()
})
);
}
}