on 2019 Aug 01 12:29 PM
Hello, experts.
I am trying to extend 'Manage Purchase Requisition - Professional' Fiori app using the adaptation project technique and have extended a view (by displaying a fragment having a button) and controller (having a method is supposed to get called when the button on the custom fragment is pressed).
What I am noticing is that the adaptation project is displaying the custom fragment and the button in it, but when the button is pressed, the method defined in custom controller isn't triggered and no error is reported in console either.
The Fragment code :
/***
@controller Name:sap.suite.ui.generic.template.ObjectPage.view.Details,
*@viewId:ui.s2p.mm.profrequisition.maintains1::sap.suite.ui.generic.template.ObjectPage.view.Details::C_PurchaseReqnItem
*/
sap.ui.define([
'sap/ui/core/mvc/ControllerExtension',
'sap/m/MessageBox'
// ,'sap/ui/core/mvc/OverrideExecution'
],
function (
ControllerExtension,
MessageBox
// ,OverrideExecution
) {
"use strict";
return ControllerExtension.extend("customer.MM_PPR_MAINTS1_ADAPTATION.SoSController", {
// // this section allows to extend lifecycle hooks or override public methods of the base controller
override: {
// override public method of the base controller
"templateBaseExtension": {
onClickActionBusinessAttachments: function (e) {
MessageBox.success("Inside onClickActionBusinessAttachments");
}
}
}
});
});
The code of custom Fragment :
<!-- Use stable and unique id's!-->
<core:FragmentDefinition xmlns:core='sap.ui.core' xmlns:m='sap.m'>
id = "ActionSheet1"
title="Choose Your Action"
showCancelButton="true"
placement="Bottom">
<m:Button id = "BusinessDocumentLink" text="Business Documents" icon="sap-icon://documents" press="onClickActionBusinessAttachments" />
</core:FragmentDefinition>
The Enhanced Screen:
Could you please help me understand where I am going wrong in here?
Many Thanks in advance.
Regards
Pranav
Request clarification before answering.
Resolved by adding .extension.<ControllerDomainAndName> before method call name.
<m:Button id = "BusinessDocumentLink" text="Business Documents" icon="sap-icon://documents" press=".extension.customer.MM_PPR_MAINTS1_ADAPTATION.SoSController.onClickActionBusinessAttachments(${PurchaseRequisition})" />
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have done the same, I am extending the controller but it is not loading in the network and the event is not triggering. can you please help with any workaround. I am working on my travel request V2 fiori element application.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
31 | |
15 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.