cancel
Showing results for 
Search instead for 
Did you mean: 

Fiori Elements - Use Action to Open a Link

Florian_Kube
Participant
0 Kudos

Hello SAP Community,

we created a RAP application with a grid table. Each item in this list has an attachment (PDF or text file) in the content repository.

The user needs to be able to view the attachment. The idea is that the attachment will be shown in a new browser tab. To generate the Link i can use function module "SCMS_URL_GENERATE". This already works.
I could use a virtual element to generate the link inside the table. But this has the disadvantage that it will generate this link for all entries even the user will not click on it.

So i would prefer to open a link when the user selcts one entry and then clicks on an action button to show the attachment.

Can may somebody help me how it would be possible to open a link when the user has clicked on an action?

Thanks for your help.

Regards, Florian

View Entire Topic
Kishannaicker
Participant
0 Kudos

Use below code in your Action press event.

window.open(yourLink);

onPress: function (oEvent) {
var oBindingContext = oEvent.getSource().getBindingContext(); var oObject = oBindingContext.getObject(); window.open(oObject.Link);
}


Regards,

Kishan Naicker