Fragment.load不是一个函数,正确构建了脚手架却仍然无法正常工作

2020-08-16 02:34发布

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

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


UI5版本:1.63.1

 sap.ui.define([
 " sap/ui/core/mvc/Controller"
 ," sap/ui/comp/valuehelpdialog/ValueHelpDialog"
 ," sap/ui/model/json/JSONModel"
 ," sap/m/ColumnListItem"
 ," sap/ui/core/Fragment"
 ," sap/ui/table/Table"
 ],函数(Controller,ValueHelpDialog,JSONModel,ColumnListItem,Table,Fragment){
 "使用严格";

 return Controller.extend(" cap.molex.Molex1_selfcodedProtoype.controller.CreateRequest",{

 onInit:函数(){
 var oModel = new JSONModel(" ./model/mockData/valueHelpData.json");
 this.getView()。setModel(oModel);
 },
 getById:函数(编号){
 返回this.getView()。byId(Id);
 }
 ,onWarehouseHelp:function(){
 如果(!this._oValueHelpDialog){
 Fragment.load({
 名称:" cap.molex.Molex1_selfcodedProtoype.fragment.valueHelp",
 控制器:这个
 })。then(function(oValueHelpDialog){
 this._oValueHelpDialog = oValueHelpDialog;
 this.getView()。addDependent(this._oValueHelpDialog);
 this._configValueHelpDialog();
 this._oValueHelpDialog.open();
 } .bind(this));
 }其他{
 this._configValueHelpDialog();
 this._oValueHelpDialog.open();
 }
 }
 ,_configValueHelpDialog:function(){
 var sInputValue = this.byId(" inWarehouse")。getValue(),
 oModel = this.getView()。getModel(),
 aWarehouses = oModel.getProperty("/img/Warehouses");


 aWarehouses.forEach(function(oWarehouse){
 oWarehouse.selected =(oWarehouse.Name === sInputValue);
 });
 oModel.setProperty("/img/Warehouses",aWarehouses);
 }
 

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

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


UI5版本:1.63.1

 sap.ui.define([
 " sap/ui/core/mvc/Controller"
 ," sap/ui/comp/valuehelpdialog/ValueHelpDialog"
 ," sap/ui/model/json/JSONModel"
 ," sap/m/ColumnListItem"
 ," sap/ui/core/Fragment"
 ," sap/ui/table/Table"
 ],函数(Controller,ValueHelpDialog,JSONModel,ColumnListItem,Table,Fragment){
 "使用严格";

 return Controller.extend(" cap.molex.Molex1_selfcodedProtoype.controller.CreateRequest",{

 onInit:函数(){
 var oModel = new JSONModel(" ./model/mockData/valueHelpData.json");
 this.getView()。setModel(oModel);
 },
 getById:函数(编号){
 返回this.getView()。byId(Id);
 }
 ,onWarehouseHelp:function(){
 如果(!this._oValueHelpDialog){
 Fragment.load({
 名称:" cap.molex.Molex1_selfcodedProtoype.fragment.valueHelp",
 控制器:这个
 })。then(function(oValueHelpDialog){
 this._oValueHelpDialog = oValueHelpDialog;
 this.getView()。addDependent(this._oValueHelpDialog);
 this._configValueHelpDialog();
 this._oValueHelpDialog.open();
 } .bind(this));
 }其他{
 this._configValueHelpDialog();
 this._oValueHelpDialog.open();
 }
 }
 ,_configValueHelpDialog:function(){
 var sInputValue = this.byId(" inWarehouse")。getValue(),
 oModel = this.getView()。getModel(),
 aWarehouses = oModel.getProperty("/img/Warehouses");


 aWarehouses.forEach(function(oWarehouse){
 oWarehouse.selected =(oWarehouse.Name === sInputValue);
 });
 oModel.setProperty("/img/Warehouses",aWarehouses);
 }
 
付费偷看设置
发送
2条回答
SC_Yao
1楼-- · 2020-08-16 03:10

您的表和片段导入被反转;)

四川大学会员
2楼-- · 2020-08-16 03:11

嗨,艾德温,

您定义的导入不正确。 如果您观察进口的顺序

," sap/ui/core/Fragment"
 ," sap/ui/table/Table" 

其中的分配是

表,片段

从技术上讲,您将函数加载在表而不是在片段上。

您只需要更正导入或分配的顺序即可。

谢谢

芦苇

一周热门 更多>