Skip to content

Commit c1537fa

Browse files
committed
Added everything for Step 11: Validation Using the Message Manager
1 parent 832f89e commit c1537fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

webapp/controller/Home.controller.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ sap.ui.define(
99
return BaseController.extend("com.mrb.UI5-Data-Binding.controller.Home", {
1010
onInit: function () {
1111
// Create a JSON model from an object literal
12-
var oModel = new JSONModel({
12+
var oModel, oMessageManager;
13+
14+
oModel = new JSONModel({
1315
firstName: "Harry",
1416
lastName: "Hawk",
1517
enabled: true,
@@ -27,6 +29,10 @@ sap.ui.define(
2729
//the go-to way for global definition would be to define the model within the manifest.json-file
2830
//and retrieve it via "this.getOwnerComponent().getModel();"
2931
this.getView().setModel(oModel);
32+
33+
//MessageManager is a singleton
34+
oMessageManager = sap.ui.getCore().getMessageManager();
35+
oMessageManager.registerObject(this.getView(), true);
3036
},
3137
});
3238
}

0 commit comments

Comments
 (0)