Validate required fields
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() }) ); } }
Could you please share complete code and plunker link so it will be easy to add
@lasterra I've included your enhancement in my pull request #11
@dmnk unfortunately doesn't work for me, see #13
i'm on it, however i can't give you an estimation when it's fixed. Thanks for the nice test-cases
Hi,
Please check whether this solution satisfies requirement: http://plnkr.co/edit/5Wxy5wzv11sGj3UQ?preview
Regards, Vladimirs