前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >使用调试的方式搞清楚SAP UI5应用标题的更改方式

使用调试的方式搞清楚SAP UI5应用标题的更改方式

作者头像
Jerry Wang
发布2020-08-20 16:37:40
6460
发布2020-08-20 16:37:40
举报

In Fiori launchpad, the page title will display default value “Home”. When I click a given tile to enter an UI5 application, the page title is changed for example from “Home” to “My Tasks”.

Today I am dealing with an incident that once I have entered one application, the page title is not displayed correctly, see below error screenshot:

In order to fix this issue, I need to know exactly which line has changed the value of page title. Since I don’t have any clue why page title becomes like this when I enter the erroneous application, so my thought is if I can test with an application where the page title works correctly, and if I can find out the line of code for title value assignment, then I can set breakpoint on that line and debug back with erroneous application.

Thanks to the power of Chrome development tool, I can finish trouble shooting in a quite efficient way.

First step, Identify which html tag holds the value of page title. Open Chrome development tool, click Elements tab and locate the tag “title”. Change its value and the change will refresh in browser immediately. This proves the fact that it is title tag which holds page title.

Then right click this title element, choose “Break on…” and mark all three options.

Now go back from application to launchpad by clicking back button, break point is triggered.

Navigate back to an application where page title display works. So it is Shell.controller.js who is responsible to change page title with variable sTitle. Now my task is to find out how variable sTitle is filled.

Go back to an outer callstack frame, sTitle comes from one attribute of object oMetadata. So where is oMetadata filled?

In line 892, now I understand: the oMetadataConfig comes from metadata configuration defined in Fiori application:

And this is i18n.properties file:

For a complete blog list of how I use Chrome development tool in my daily work, please find it from this blog: Chrome Development Tool tips used in my daily work.

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-08-19 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档