訪問或引用 SAP UI5 控制元件
這裡出現了一個小問題。addContent 方法是適用於 UI5 控制元件的方法,而不適用於普通 DOM 元素。
如果您想獲取按鈕的引用,則可以嘗試以下程式碼段
this.getView().byId("<id of the toolbar>").addContent(new sap.m.Button({ <property>:<value> }));
廣告
這裡出現了一個小問題。addContent 方法是適用於 UI5 控制元件的方法,而不適用於普通 DOM 元素。
如果您想獲取按鈕的引用,則可以嘗試以下程式碼段
this.getView().byId("<id of the toolbar>").addContent(new sap.m.Button({ <property>:<value> }));