on 07-03-2015 2:50 AM
Hi Guys,
I am now following the latest walkthrough tutorial in http://veui5infra.dhcp.wdf.sap.corp:8080/demokit/#docs/guide/8f93bf2b2b13402e9f035128ce8b495f.html
after I define the i18n model metadata in manifest.json . see "manifest.json" in the above url
while I set breakpoint in Component.js 's init() method, and by accessing this.getMetadata()._oStaticInfo.manifest, I see all
the metadata parsed. see attached file "Capture1.png"
However, when I try to acces i18n model by this.getModel("i18n"), I get nothing. see attached "Capture2.png"
neither can I access the i18n model in view's controller by this.getView().getModel("i18n").
However, ui5 do parse the "rootView" property under "sap.ui5" in manifest.json file. otherwise the rootView will not be loaded and initiated.
see attached "Capture3.png"
seems that manifest json is loaded and parsed, but only partly used. the i18n is not initiated.
I am doubting that I have configured it wrong, but I fully downloaded from tutorial. and since this manifest.json is newly introduced and with limited material for reference, I have no idea where to go except dive into ui5-core souce code, which takes much time.
I am wondering if anyone met this before .
Thanks,
Hi Torren,
I am also beginner for this SAPUI5 and my manifest.json file is not working. If I use simple rootView in metadata of component.js file then it is working fine but not working with manifest.json file.
my sap.ui.version is 1.30.3.
Please help if your problem got resolved.
Thanks & Regards,
Vardan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Torren,
First thing to access the i18n model is that you need to create a "Resource Model" instance and then set the view.
Below is the piece of code i have user for i18n in my component.js file.
Step1: Define resourceBundel <path of you i18n files>
config : {
resourceBundle : "i18n/messageBundle.properties"
serviceConfig : {
name : <Your Service Name>,
serviceUrl : <Your Service URL>
}
Step2: Define rootPath resource Model.
// always use absolute paths relative to our own component
// (relative paths will fail if running in the Fiori Launchpad)
var rootPath = jQuery.sap.getModulePath(<Root folder name>);
// set i18n model
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : [rootPath, mConfig.resourceBundle].join("/")
});
this.setModel(i18nModel, "i18n");
Hope this will help you.
Regards,
Abhijeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Parihar,
the way you recommend is the traditional way, but the latest ui5 of version 1.30 provide a new way of creating the model. Actually you don't need to create the model your self, you just need to give the model metadata in manifest.json file, and ui5 will take care of the rest for you.
I just find that my ui5 version is less than 1.30, so this function is not provided yet.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.