Skip to Content

Changing semantic:DetailPage title

Hello,

I would like to change the title of semantic:DetailPage based on what is being clicked on the page.

Example there are two buttons new and edit, both are in the same controller file and both have the same view file.

Now i want based on what was clicked new/edit to change the title.

i can get the page title with this.byId("semanticdetailid").getTitle()

setTitle doesnt work

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jul 02, 2019 at 03:52 PM

    Hi Roman M,

    This should be done Model though.. But you have another option if requirement just to change title of page based on button click.

    1- Give some ID to your page tag in your XMl view. In below case "page1" is ID of page where you want to change Title to get it identified uniquely.

    2- On button click you can add below code to update title.

    var opage1 = sap.ui.getCore().byId("page1");
    opage1.setTitle("<yourdynamictitle>");
    

    Please see below page for reference and search for setTitle method.

    https://ui5.sap.com/#/api/sap.m.Page

    Hope this helps..

    Thanks-

    Abhishek

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.