0
我刷新我的視圖模型onRouteMatched ...如何刷新視圖?
_onRouteMatched: function(oEvent) {
this.getView().setModel(new JSONModel({siteInfo: {}, surveyInfo: {}, categories: []}), "view");
var oViewModel = this.getView().getModel("view");
}
但是,如果我返回頁面無刷新(按後退箭頭,然後再返回),我得到一個重複COMPONENTID再次創建視圖時出錯。
var oPanel = new sap.m.Panel({
expandable: true,
expanded: false,
headerText: oData.results[0].CategoryDesc,
id: "Panel" + index
});
就好像視圖組件「面板」依然存在,使新人們只能在刷新創建,而不是onRouteMatched。
這工作正常,如果我刷新頁面,但我怎麼能得到視圖刷新onRouteMatched?
沒有什麼真正的工作,所以我採取了你的建議使用視圖...直接與面板headerText雖然卡住了... https://stackoverflow.com/questions/46879029/sapui5-views-accessing-model-項換面板頭 –