你选择1是不可能的(为什么呢?因为添加按钮,页脚有controllerHook
没有UI扩展点)
与选项2一起使用,在应用程序详细信息页面的所有控制器(S3.controller.j和S3_phone.controller.js)中已经提供了extensionHooks 。
controllerHook: extHookChangeFooterButtons
默认情况下,SAP构建headerFooterOptions并将该对象发送到扩展名Hook
/**
* @ControllerHook Modify the footer buttons
* This hook method can be used to add and change buttons for the detail view footer
* It is called when the decision options for the detail item are fetched successfully
* @callback hcm.emp.payslip.view.S3_Phone~extHookChangeFooterButtons
* @param {object} objHdrFtr-Header Footer Object
* @return {object} objHdrFtr-Header Footer Object
*/
if (this.extHookChangeFooterButtons) {
objHdrFtr = this.extHookChangeFooterButtons(objHdrFtr);
}
因此,在扩展控制器中,您将收到相同的追加:
extHookChangeFooterButtons: function (objHdrFtr) {
//first if the buttonsList is empty, create one.
//Actually in S3.controller.js buttonsList is not defined since there are no buttons
if (!objHdrFtr.buttonList) {
objHdrFtr.buttonList = [];
}
//then create a button:
var extendedButton = {
sId: "EXT_BUTTON",
sI18nBtnTxt: "SAMPLE", //make sure you add texts in respective i18n files
bEnabled: true,
onBtnPressed: function (evt) {
that.handleExtButtonPress(evt);
}
};
objHdrFtr.buttonList.append(extendedButton)
//as you can see SAP says to return the object
return objHdrFtr;
}
建议:在Web IDE中非常容易做到。为什么?
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句