我的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)没有称为页面的聚合”。
发布评论