cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Fiori Adaptation Project : Controller Method not getting triggered

Former Member
0 Kudos
2,578

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

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})" />

23_Suman
Explorer
0 Kudos
Why " ${PurchaseRequisition} "is used?

Answers (1)

Answers (1)

0 Kudos

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.

23_Suman
Explorer
0 Kudos
Did you find any solution of that issue? I am also facing the same issue in My Travel request V2 app.