示例应用程序中的分割视图错误

2020-09-26 19:44发布

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

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


嗨,大家好,

我正在尝试创建splitview页面。我遇到此错误

目标Main没有设置controlId,也没有父对象,因此无法显示目标。 -EventProvider sap.ui.core.routing.Target

Manifest.json

 {
 " _version":" 1.7.0",
 " sap.app":{
 " id":" finalappfinalapp",
 " type":"应用程序",
 " i18n":" i18n/i18n.properties",
 " applicationVersion":{
 " version":" 1.0.0"
 },
 " title":" {{appTitle}}",
 " description":" {{appDescription}}",
 " sourceTemplate":{
 " id":" ui5template.basicSAPUI5ApplicationProject",
 "版本":" 1.40.12"
 }
 },
 " sap.ui":{
 " technology":" UI5",
 "图标":{
 " icon":"",
 " favIcon":"",
 "电话": "",
 " phone @ 2":"",
 " tablet":"",
 " tablet @ 2":""
 },
 " deviceTypes":{
 "桌面":是的,
 "平板电脑":是的,
 "电话":正确
 },
 " supportedThemes":[" sap_hcb"," sap_belize"]
 },
 " sap.ui5":{
 " rootView":{
 " viewName":" finalappfinalapp.view.App",
 " type":" XML"
 },
 "依赖关系":{
 " minUI5Version":" 1.30.0",
 " libs":{
 " sap.ui.core":{},
 " sap.m":{},
 " sap.ui.layout":{},
 " sap.ushell":{},
 " sap.collaboration":{},
 " sap.ui.comp":{},
 " sap.uxap":{}
 }
 },
 " contentDensities":{
 "紧凑":是的,
 "舒适":是
 },
 "楷模": {
 " i18n":{
 " type":" sap.ui.model.resource.ResourceModel",
 "设置":{
 " bundleName":" finalappfinalapp.i18n.i18n"
 }
 }
 },
 "资源":{
 " css":[{
 " uri":" css/style.css"
 }]
 },
 "路由":{
 " config":{
 " viewPath":" finalappfinalapp.view",
 " viewType":" XML",
 " transition":" slide",
 " clearTarget":false
 },
 "目标":{
 "主要":{
 " viewType":" XML",
 " transition":" slide",
 " clearAggregation":正确,
 " viewName":" Main",
 " title":"主要",

 " viewPath":" finalappfinalapp.view.Main"
 },
 "详细信息":{
 " viewType":" XML",
 " transition":" slide",
 " clearAggregation":正确,
 " viewName":"详细信息",
 " title":"详细信息",
 " controlId":" SplitApp",
 " viewPath":" finalappfinalapp.view.Detail"
 }
 },
 "路线":[{
 " name":" Main",
 " pattern":"",
 " titleTarget":" Main",
 " controlAggregation":"主页",
 " target":[" Main"]
 },{
 " name":"详细信息",
 " pattern":"",
 " titleTarget":"详细信息",
 "目标":["详细信息"]
 }]
 }
 }
 }
 

App.xml

 
 
 
 

Main.xml

 
 
 <页面>
 <页面标题="主要">
  
 
 
 
 
 

Detail.xml

 
 
 <页面>
 <页面标题="详细">
  
 
 
 
 
 

Component.js

 sap.ui.define([
 " sap/ui/core/UIComponent",
 " sap/ui/设备",
 " finalappfinalapp/模型/模型"
 ],功能(UIComponent,设备,模型){
 "使用严格";


 返回UIComponent.extend(" finalappfinalapp.Component",{


 元数据:{
 清单:" json"
 },


/**
 *该组件在应用程序启动期间由UI5自动初始化,并一次调用init方法。
 * @上市
 * @override
 */
 初始化:function(){
//调用基本组件的init函数
 UIComponent.prototype.init.apply(this,arguments);
 this.getRouter()。initialize();
//设置设备型号
 this.setModel(models.createDeviceModel()," device");
 }
 });
 });
 

请建议我设计页面

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

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


嗨,大家好,

我正在尝试创建splitview页面。我遇到此错误

目标Main没有设置controlId,也没有父对象,因此无法显示目标。 -EventProvider sap.ui.core.routing.Target

Manifest.json

 {
 " _version":" 1.7.0",
 " sap.app":{
 " id":" finalappfinalapp",
 " type":"应用程序",
 " i18n":" i18n/i18n.properties",
 " applicationVersion":{
 " version":" 1.0.0"
 },
 " title":" {{appTitle}}",
 " description":" {{appDescription}}",
 " sourceTemplate":{
 " id":" ui5template.basicSAPUI5ApplicationProject",
 "版本":" 1.40.12"
 }
 },
 " sap.ui":{
 " technology":" UI5",
 "图标":{
 " icon":"",
 " favIcon":"",
 "电话": "",
 " phone @ 2":"",
 " tablet":"",
 " tablet @ 2":""
 },
 " deviceTypes":{
 "桌面":是的,
 "平板电脑":是的,
 "电话":正确
 },
 " supportedThemes":[" sap_hcb"," sap_belize"]
 },
 " sap.ui5":{
 " rootView":{
 " viewName":" finalappfinalapp.view.App",
 " type":" XML"
 },
 "依赖关系":{
 " minUI5Version":" 1.30.0",
 " libs":{
 " sap.ui.core":{},
 " sap.m":{},
 " sap.ui.layout":{},
 " sap.ushell":{},
 " sap.collaboration":{},
 " sap.ui.comp":{},
 " sap.uxap":{}
 }
 },
 " contentDensities":{
 "紧凑":是的,
 "舒适":是
 },
 "楷模": {
 " i18n":{
 " type":" sap.ui.model.resource.ResourceModel",
 "设置":{
 " bundleName":" finalappfinalapp.i18n.i18n"
 }
 }
 },
 "资源":{
 " css":[{
 " uri":" css/style.css"
 }]
 },
 "路由":{
 " config":{
 " viewPath":" finalappfinalapp.view",
 " viewType":" XML",
 " transition":" slide",
 " clearTarget":false
 },
 "目标":{
 "主要":{
 " viewType":" XML",
 " transition":" slide",
 " clearAggregation":正确,
 " viewName":" Main",
 " title":"主要",

 " viewPath":" finalappfinalapp.view.Main"
 },
 "详细信息":{
 " viewType":" XML",
 " transition":" slide",
 " clearAggregation":正确,
 " viewName":"详细信息",
 " title":"详细信息",
 " controlId":" SplitApp",
 " viewPath":" finalappfinalapp.view.Detail"
 }
 },
 "路线":[{
 " name":" Main",
 " pattern":"",
 " titleTarget":" Main",
 " controlAggregation":"主页",
 " target":[" Main"]
 },{
 " name":"详细信息",
 " pattern":"",
 " titleTarget":"详细信息",
 "目标":["详细信息"]
 }]
 }
 }
 }
 

App.xml

 
 
 
 

Main.xml

 
 
 <页面>
 <页面标题="主要">
  
 
 
 
 
 

Detail.xml

 
 
 <页面>
 <页面标题="详细">
  
 
 
 
 
 

Component.js

 sap.ui.define([
 " sap/ui/core/UIComponent",
 " sap/ui/设备",
 " finalappfinalapp/模型/模型"
 ],功能(UIComponent,设备,模型){
 "使用严格";


 返回UIComponent.extend(" finalappfinalapp.Component",{


 元数据:{
 清单:" json"
 },


/**
 *该组件在应用程序启动期间由UI5自动初始化,并一次调用init方法。
 * @上市
 * @override
 */
 初始化:function(){
//调用基本组件的init函数
 UIComponent.prototype.init.apply(this,arguments);
 this.getRouter()。initialize();
//设置设备型号
 this.setModel(models.createDeviceModel()," device");
 }
 });
 });
 

请建议我设计页面

付费偷看设置
发送
1条回答
亦是此间程序员
1楼-- · 2020-09-26 20:47

嗨,

在Manifest.json文件下,在"路由"部分中进行如下更改。

" controlAggregation":"母版页" 

在您看来,请删除容器。 它不是必需的。您的视图必须喜欢这个

 
 <页面标题="详细">
  
 
  

请尝试这个。

一周热门 更多>