SAPUI5路由抛出错误“控件(应用程序控件的ID)没有称为页面的聚合”。

编程入门 行业动态 更新时间:2024-10-26 05:17:06
本文介绍了SAPUI5路由抛出错误“控件(应用程序控件的ID)没有称为页面的聚合”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的Component.js中包含以下路线:

What I have in my Component.js are these routes:

routes: [ { pattern: "", name: "menu", view: "Menu", targetAggregation: "pages", targetControl: "idAppControl", subroutes: [ { pattern: "Reports", name: "reports", view: "SplitContainer", targetAggregation: "pages", targetControl: "idAppControl", clearTarget: true } ] } ]

当我尝试访问子路由(URL /#/ Reports)时,应用程序抛出(Chrome):

When I try to access the subroute (URL/#/Reports) the application throws (Chrome):

Co ntrol idAppControl没有名为pages的聚合-

Control idAppControl does not has an aggregation called pages -

由于 idAppControl是一个应用程序而引起的混淆具有聚合页面。另外,即使我使用与子路由完全相同的控件(和聚合),第一个主路由也可以很好地工作。

This is confusing due to the fact, that "idAppControl" is an App and therefor HAS an aggregation pages. Also, the first "main" route works pretty well, even though I'm using exactly the same control (and aggregation) as in the subroute.

可能出了什么问题?

推荐答案

我发现了问题所在。有点范围问题。您无法加入与父路线相同的控件。 您可能会产生以下错误消息,并且存在相同的问题:

I've found out what's wrong. It's kinda a "scope" problem. You can't join the same control as your parent route has. You can produce the following error message with the same problem:

找不到ID为IDAppControl的控件

Control with ID idAppControl could not be found

我所做的是:

routes: [ { pattern: "", name: "menu", view: "Menu", targetAggregation: "pages", targetControl: "idAppControl" }, { pattern: "Reports", name: "reports", view: "SplitContainer", targetAggregation: "pages", targetControl: "idAppControl", clearTarget: true } ]

回想起来,这似乎很合逻辑:D

In retrospect this seems to be quite logical :D

更多推荐

SAPUI5路由抛出错误“控件(应用程序控件的ID)没有称为页面的聚合”。

本文发布于:2023-11-22 09:50:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1616950.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   路由   抛出   应用程序   错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!