Skip to Content
avatar image
Former Member

Dynamic App Title for Fiori Apps

Hi Experts,

I want to manipulate the app title (red box on screenshot below) at runtime for an app I have recently developed:

The title marked in red is coming from the manifest.json of my application (it actually refers to the i18n model):

I have not found any way to change the title (red box first screenshot) at runtime (e.g. depending on start up parameters of the app). It seems to be a read only property at the manifest object that is unchangeable.

Any help/ideas appreciated.

Regards

Tobias

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jun 06, 2017 at 08:46 AM

    if title is coming from i18n then, to change i18n labels is not a good idea, since this is static text you can have as many static text i.e. appTitle=title1, appTitle1=title2

    var oBundle = get your i18n model here
    var title = "";
    if(condition){
      title = oBundle.getText("appTitle");
    }else {
      title = oBundle.getText("appTitle1");
    } 
    var oModel = new JSONModel({ pageTitle: title});
    now bind this model with property title 
    
    title="{/pageTitle}" 
    Add comment
    10|10000 characters needed characters exceeded

    • Hi Akhilesh,

      I tried your solution for my requirement, and I am faced with some errors, Could you please tell me where am I going wrong.

      First I tried running this piece of code in my controller under onInit() function but it threw an error in my manifest file in the title declaration part. Then I tried it again in my Component.js file and this time i set the model to my core and assigned it a name, still I'm faced with the same error.

      Below is the code i used in Component.js file after validating my condition, and its corresponding path mentioned in manifest.json

      	var oModel = new JSONModel({
      				"title": title,
      				"appTitle": appTitle,
      				"appDescr": appDescr
      			});
      			sap.ui.getCore().setModel(oModel, "oModel");
      

      path with model name

      Below is the code without setting the model to the core nor giving it any name, and its corresponding path mentioned in manifest.json

      	var oModel = new JSONModel({
      				"title": title,
      				"appTitle": appTitle,
      				"appDescr": appDescr
      			});
      

      path without model name

      Any guidance on how to make this code work is highly appreciated.

      Thanks

      Imtiaz N

  • avatar image
    Former Member
    Jun 05, 2017 at 08:50 AM

    Hi Tobias,

    You have to change the name in LPD_CUST and that name will reflect on launchpad.

    Thanks,

    Swati

    Add comment
    10|10000 characters needed characters exceeded