Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

How to share a ResourceModel In a UIComponent?

$
0
0

Hi All,

 

In my sap.ui.core.UIComponent.init I have the following:

 

var oModel = new sap.ui.model.resource.ResourceModel({bundleName : "path/bundle", bundleLocale:sap.m.getLocale().sLocaleId});

this.setModel(oModel , "i18n");

 

The UIComponent creates a sap.ui.view.

 

The translation in the view works fine, but not for fragments/dialogs that are created from the view.

 

I thought of 2 solutions:

 

1. For each fragments/dialogs that are created, set the view model to them.

2. sap.ui.getCore().setModel(oModel , "i18n");

 

What is the best approach? Do you have another solution for this issue?

 

Thanks in advance


Viewing all articles
Browse latest Browse all 6178

Trending Articles