cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori Elements: Custom Buttons not directing to the corresponding code

max_mueller007
Explorer
0 Kudos
848

Hi,

I am working on my first fiori app by following Excel Upload using RAP: Part -3 | SAP Blogs

Since the blog is a bit old now I have had to edit a few things from the blog to make it work.

Now, I am able to get the Upload dialog box, but the buttons on it do not work.

This is my file structure:

Following is the code snippet in the controller for one of the buttons:

Following is the fragment used:

Following is my Output:

While the upload button at the top works, none of the 3 at the bottom work.

I tried changing in the fragment

<Button id="Template" text="Template" press="onTempDownload" icon="sap-icon://download-from-cloud" type="Emphasized"/><br>

to

<Button id="Template" text="Template" press=".onTempDownload" icon="sap-icon://download-from-cloud" type="Emphasized"/><br>

by adding a dot so it refers to the controller

as well as to

<Button id="Template" core:require="{ handler: '/home/user/projects/ypgms_building_v2/webapp/ext/controller/ListReportExt'}" text="Template" press="handler.onTempDownload" icon="sap-icon://download-from-cloud" type="Emphasized"/>

but this second correction gives me an error that this path is not under the Resources. I am not sure how to get the /ext folder to show under the Resources section in the F12 Developer Options.

What would be the right way to proceed?

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

Marian_Zeis
Active Contributor
0 Kudos

Based on this excel blog post i created a free and open source Component to upload excel files so you dont need to write your own code.
It may helps you;
https://spreadsheet-importer.com/

max_mueller007
Explorer
0 Kudos

Hi Marian,

Thanks for the link. I am trying this out using the documentation on https://docs.spreadsheet-importer.com/pages/Button/

However, since my model exists on Steampunk on Eclipse, I do not have any XML view in my project, where should I add the corresponding code?

Thanks.

Marian_Zeis
Active Contributor
0 Kudos

max_mueller007 What do you mean you dont have a XML View?

What is your Use Case and Setup?

You can open the dialog only with Code, see here:
https://docs.spreadsheet-importer.com/pages/GettingStarted/

max_mueller007
Explorer
0 Kudos

20eed143c19f4b82bc4cf049916102cb : Thank Marian for this link. this seems to be the one that I need. However, I get the this.getView is not a function error when executing it:

What do you think?

Many Thanks.

Marian_Zeis
Active Contributor
0 Kudos

max_mueller007

The "getView" depends on the context. For example it is different between OData V2 and V4 Fiori Elements Application.

The best way is to set a break point and check what "this" gives you.

What could work is "this.editFlow.getView()" for example in V4