Hello Experts,
I've a TextField in my SAPUI5 application with some constraints:
<sap.ui.commons:TextField validationError="validatePriceError" parseError="validatePriceError" formatError="validatePriceError" validationSuccess="validatePriceSuccess" value="{ path: 'oTblReqLinesModel>price', type : 'sap.ui.model.type.Float', formatOptions : { maxFractionDigits: 2, minFractionDigits: 2, decimalSeparator: '.' }, constraints : { minimum: 0.01 } }"></sap.ui.commons:TextField>
I'm using a validation function and it works:
validatePriceError : function(oEvent) { var oCtrl = oEvent.getParameter("element"); var sValueState = "someError..."; var oRttTextField = new sap.ui.commons.RichTooltip({ valueStateText : sValueState }); oCtrl.setValueState(sap.ui.core.ValueState.Error); oCtrl.setTooltip(oRttTextField); var oView = sap.ui.getCore().byId("app"); var oController = oView.getController(); oController.setTotal(); }
I also have a "Check Form" button.
How can I trigger the 'validatePriceError' function? (without writing the constraints logic again or add more functions)
Regards,
Omri