SAPUI5 validation input box content

 sapui5 verify whether the input box is a number type

Code:
var oResourceModel = new sap.ui.model.resource.ResourceModel ({
        bundleName:"sap.ui.demo.db.i18n.i18n"	
});
sap.ui.getCore().setModel(oResourceModel,"i18n");
var oView = sap.ui.core.mvc.XMLView({viewName:"sap.ui.demo.db.view.App"});
sap.ui.getCore().getMessageManager().registerObject(oView,true);
oView.placeAt("content");
  The XML view is now created as a named object called oView.
The view object oView is registered with the MessageManager.
Once registered, the XML view is inserted into the DOM as before.
You can now enter non-numeric values ​​in input boxes and press Enter or move focus to other UI controls. This action triggers the onenter or onchange event, and then SAPUI5 performs the validation function belonging to the sap.ui.model.type.Currency data type.
Now that the view is registered with the MessageManager, any validation error messages will be picked up by the MessageManager, which will check its list of registered objects and pass the error message back to the correct view for display.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326614620&siteId=291194637