@@ -2,9 +2,9 @@ sap.ui.define(
22 [
33 "com/mrb/UI5-Data-Binding/controller/BaseController" ,
44 "sap/ui/model/json/JSONModel" ,
5- "sap/ui/model/BindingMode" ,
5+ "sap/ui/model/resource/ResourceModel"
66 ] ,
7- function ( BaseController , JSONModel , BindingMode ) {
7+ function ( BaseController , JSONModel , ResourceModel ) {
88 "use strict" ;
99
1010 return BaseController . extend ( "com.mrb.UI5-Data-Binding.controller.Home" , {
@@ -17,11 +17,17 @@ sap.ui.define(
1717 panelHeaderText : "Data Binding Basics" ,
1818 } ) ;
1919
20- oModel . setDefaultBindingMode ( BindingMode . OneWay ) ;
20+ // Create a resource bundle for language specific texts
21+ // nowadays those are being declared via manifest.json
22+ var oResourceModel = new ResourceModel ( {
23+ bundleName : "com.mrb.UI5-Data-Binding.i18n.i18n_example" ,
24+ } ) ;
25+
2126 //Set model globally for all views/controls (dirty) "sap.ui.getCore().setModel(oModel);""
2227 //the go-to way for global definition would be to define the model within the manifest.json-file
2328 //and retrieve it via "this.getOwnerComponent().getModel();"
2429 this . getView ( ) . setModel ( oModel ) ;
30+ this . getView ( ) . setModel ( oResourceModel , "i18n_example" )
2531 } ,
2632 } ) ;
2733 }
0 commit comments