cancel
Showing results for 
Search instead for 
Did you mean: 

how to register event in Fiori element extension app in Business Application Studio

0 Kudos
766

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

former_member577849
Active Participant
0 Kudos

Dear Siddharth,

Unfortunately, it seems to be taking longer than usual for your question to be answered. You might want to try an alternative route to speed things up.

Please check if a similar question has already been asked in the Community. We have found that sometimes questions that have been answered before are no longer receiving responses.

The easiest way to do this, is to visit the All Questions page and search for your specific topic.

You could also check the SAP Support Portal and search for SAP Notes, SAP Knowledge Base Articles and more.

Thanks,

Marvin

Accepted Solutions (0)

Answers (1)

Answers (1)

gregorw
Active Contributor

Have you tried changing

press="onAttachment"

to:

press=".extension.zproductmaster.fragAttachment.onAttachment"

?