on 2021 Jun 24 9:52 AM
Dear SAP Community,
I am extending the Manage Purchase Order Fiori App using the Business Application Studio. i have created a fragment and added a button with it in the list report. i have also coded a controller for the same, but on press of the button no event is being triggered.
i read in a blog that i should maintain the event in the manifest.json file but that does exist in this adaptation project.
how do i add this event and trigger the code in the controller
fragment:
<!-- Use stable and unique id's!-->
<core:FragmentDefinition xmlns:core='sap.ui.core' xmlns='sap.m'>
<Button id="btnAttachment" text="Attachment" press="onAttachment"></Button>
</core:FragmentDefinition>
controller:
/***
@controller Name:sap.suite.ui.generic.template.ListReport.view.ListReport,
*@viewId:mdm.cmd.product.maintain::sap.suite.ui.generic.template.ListReport.view.ListReport::C_Product
*/
sap.ui.define([
'sap/ui/core/mvc/ControllerExtension'
// ,'sap/ui/core/mvc/OverrideExecution'
],
function (
ControllerExtension
// ,OverrideExecution
) {
"use strict";
return ControllerExtension.extend("zproductmaster.fragAttachment", {
onInit: function() {
alert("onInit");
},
onAttachment:function(){
alert("onAttachment");
}
});
});
regards
Siddharth Shaligram
Have you tried changing
press="onAttachment"
to:
press=".extension.zproductmaster.fragAttachment.onAttachment"
?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
10 | |
10 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.