我正在实现表个性化(sap.m.TablePersoController),该个性化将表的用户特定设置保留在Fiori Launchpad的ushell服务上。
但是当我在Fiori Launchpad中运行应用程序时,看到以下错误。
Error: "[object Object]" is not valid for aggregation "persoService" of ManagedObject sap.m.TablePersoController#oTablePerso
您能让我知道问题是什么以及如何解决。
下面是相同的代码:
var oPersonalizationService= window.parent.sap.ushell.Container.getService("Personalization");
var oPersId = {
container : "AppPersSample2",
item : "mobiletable"
};
var oMobileTable = sap.ui.getCore().byId("idTable");
var oStartPersButton = sap.ui.getCore().byId("idButton");
var oPersonalizer = oPersonalizationService.getPersonalizer(oPersId);
console.log("oPersonalizer is:"+oPersonalizer);
// Create a table personalization controller
jQuery.sap.require("sap.m.TablePersoController");
jQuery.sap.require("sap.m.TablePersoDialog");
var oTablePersoController = new sap.m.TablePersoController("oTablePerso",{
table : oMobileTable,
persoService : oPersonalizer
});
// Use the personalization data to configure the table accordingly
oTablePersoController.activate();
我真的不知道错误是从哪里来的,但是对于调试,您可以分割这行
var oTablePersoController = new sap.m.TablePersoController("oTablePerso",{ table : oMobileTable, persoService : oPersonalizer });
进入
var oPersonalizationService = sap.ushell.Container.getService("Personalization");
var oProvider = sap.ushell.Container.getService("Personalization").getPersonalizer(oPersId);
this._oTPC = new sap.m.TablePersoController({});
this._oTPC.setPersoService(oProvider);
this._oTPC.setTable(oMobileTable);
只需尝试一下并设置断点