tfOppnumber.attachValidationError(function(error){ this.setValueState(sap.ui.core.ValueState.Error); this.setValueStateText(error.mParameters.exception.message); }, tfOppnumber); tfOppnumber.getBinding("value").setType( { formatValue : function(sValue, sTargetType) { }, parseValue : function (sValue, sSourceType) { return sValue; }, validateValue : function (sValue) { if (sValue.length!=4) { throw new sap.ui.model.ValidateException("Year must be 4 chars long"); } }, getName : function () { return "my.type.Year"; } } );