How to Use the Internalization i18n Model in a Dialog in SAP UI5?


It is possible to use the internalization i18n model in a sap.m.Dialog as well. You just need to add the dialog to the dependent aggregation of the sap.ui.core.mvc.View of the dialog:

<!-- view -->

    <Button text="Dialog" press="onDialogPress"/>

// controller
], function(Controller) {
  "use strict";
  return Controller.extend("foo.controller.Controller", function() {
    _openDialog: function() {
      if (!this.oDialog) {         
        // instantiate dialog if no dialog exist 
        this.oDialog = new Dialog();     


      // add the dialog as dependent to the view     
      this.getView().addDependent(this.oDialog);  ; 


After you added the dialog to the dependent aggregation of the view the internalization i18n model is available in the dialog.

No Comments

FREE SAP Modules Overview! (Complete)

Plus, receive all future infographics and SAP tips & insights that are only shared with the private newsletter subscribers. 

Latest Poll
Essential Ressources

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.