SAP UI5路由错误:找不到带有ID应用程序的控件

2020-08-14 14:23发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


专家们,

启动我的应用时,我收到找不到ID为ID的应用的控件错误。 我试图检查论坛并看到类似的问题,但尼特根据其他主题的建议无法解决问题。

错误:

L og-dbg.js:456 2020-07-25 17:32:04.146040找不到具有ID应用程序的控件-EventProvider sap.m.routing.Target

Target-dbg.js:29未捕获的TypeError:无法读取未定义的属性'oTargetControl'

文件夹结构:

仅供参考(这样就不会造成混淆),您可以忽略JS视图,因为我不使用JS视图,而仅使用XML视图

id为" app"的应用视图,在清单的路由部分中匹配为id为rootView的

Index.html

Component.js

基于调试,问题在于它触发路由初始化并尝试加载作为应用程序视图的rootView时。

奇怪的是,尽管App.view具有id应用,但找不到id应用。

清单(显示 rootView):

{" _version":" 1.1.0"," sap.app":{" _version":" 1.1.0"," id":" sapui5.demo.mvcapp"," type":"应用程序" ," i18n":" i18n/i18n.properties"," applicationVersion":{" version":" 1.0.0"}," title":" {{appTitle}}"," description":" {{appDescription} }"," dataSources":{" mainService":{" uri":" ./service/data.json"," type":" JSON"}}}," sap.ui":{" _version":" 1.1.0"," technology":" UI5"," deviceTypes":{" desktop":true," tablet":true," phone":true}," supportedThemes":[" sap_bluecrystal"]}," sap .ui5":{" _version":" 1.1.0", " rootView":{" viewName":" sapui5.demo.mvcapp.view.App"," type":" XML"} ,"依赖项":{" minUI5Version":" 1.30.0","库":{" sap.m":{}}}}," contentDensities":{" compact":true ," cozy":true}," models":{"":{" dataSource":" mainService"}," i18n":{" type":" sap.ui.model.resource.ResourceModel","设置" :{" bundleName":" sapui5.demo.mvcapp.i18n.i18n"}}},"路由":{" config":{" routerClass":" sap.m.routing.Router"," viewType":" XML"," viewPath":" sapui5.demo.mvcapp.view"," controlId":" app"," controlAggregation":"页面"," bypassed":{" target":" notFound"} }," routes":[{" pattern":""," name":" master"," target":" master"}]," targets":{" master":{" viewName":" Master" ," viewLevel":1}," detail":{" viewName":" Detail"," viewLevel":2}," notFound":{" viewName":" NotFound"," viewId":" notFound"}} }

您能告诉我在显示应用程序视图的代码中我缺少什么吗?

谢谢

Govind Parmar

(14.6 kB)

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


专家们,

启动我的应用时,我收到找不到ID为ID的应用的控件错误。 我试图检查论坛并看到类似的问题,但尼特根据其他主题的建议无法解决问题。

错误:

L og-dbg.js:456 2020-07-25 17:32:04.146040找不到具有ID应用程序的控件-EventProvider sap.m.routing.Target

Target-dbg.js:29未捕获的TypeError:无法读取未定义的属性'oTargetControl'

文件夹结构:

仅供参考(这样就不会造成混淆),您可以忽略JS视图,因为我不使用JS视图,而仅使用XML视图

id为" app"的应用视图,在清单的路由部分中匹配为id为rootView的

Index.html

Component.js

基于调试,问题在于它触发路由初始化并尝试加载作为应用程序视图的rootView时。

奇怪的是,尽管App.view具有id应用,但找不到id应用。

清单(显示 rootView):

{" _version":" 1.1.0"," sap.app":{" _version":" 1.1.0"," id":" sapui5.demo.mvcapp"," type":"应用程序" ," i18n":" i18n/i18n.properties"," applicationVersion":{" version":" 1.0.0"}," title":" {{appTitle}}"," description":" {{appDescription} }"," dataSources":{" mainService":{" uri":" ./service/data.json"," type":" JSON"}}}," sap.ui":{" _version":" 1.1.0"," technology":" UI5"," deviceTypes":{" desktop":true," tablet":true," phone":true}," supportedThemes":[" sap_bluecrystal"]}," sap .ui5":{" _version":" 1.1.0", " rootView":{" viewName":" sapui5.demo.mvcapp.view.App"," type":" XML"} ,"依赖项":{" minUI5Version":" 1.30.0","库":{" sap.m":{}}}}," contentDensities":{" compact":true ," cozy":true}," models":{"":{" dataSource":" mainService"}," i18n":{" type":" sap.ui.model.resource.ResourceModel","设置" :{" bundleName":" sapui5.demo.mvcapp.i18n.i18n"}}},"路由":{" config":{" routerClass":" sap.m.routing.Router"," viewType":" XML"," viewPath":" sapui5.demo.mvcapp.view"," controlId":" app"," controlAggregation":"页面"," bypassed":{" target":" notFound"} }," routes":[{" pattern":""," name":" master"," target":" master"}]," targets":{" master":{" viewName":" Master" ," viewLevel":1}," detail":{" viewName":" Detail"," viewLevel":2}," notFound":{" viewName":" NotFound"," viewId":" notFound"}} }

您能告诉我在显示应用程序视图的代码中我缺少什么吗?

谢谢

Govind Parmar

(14.6 kB)
付费偷看设置
发送
2条回答
hongfeng1314
1楼 · 2020-08-14 14:42.采纳回答

删除createContent方法。

太Q了
2楼-- · 2020-08-14 14:44

查看您的路由配置,您想创建主详细信息视图应用程序,因此使用SplitApp代替App。

在App.View.xml文件中,

删除此行
并添加

一周热门 更多>