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

Get A COMPLETE SAP Modules Overview infographic (free)

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

Complete SAP modules/components overview infographic.
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.