- Build the url
- Generate the key of the pdf entity via
createKey
- Concatenate it with the service url
- Don’t forget to add
/$value
to the url
- Open the url in a new tab via
sap.m.URLHelper.redirect
/**
* @description Generates the pdf link
* @param {string} sParameter - Parameter
* @returns {string} pdf link
*/
_generatePDFLink: function(sParameter) {
var oServiceModel = this.getOwnerComponent().getModel(),
sServiceURL = oServiceModel.sServiceUrl,
sPath,
sPDFURL;
sPath = oServiceModel.createKey("/LoremIpsumSet", {
Parameter: sParameter
});
sPDFURL = sServiceURL + sPath + "/$value";
return sPDFURL;
},
/**
* @description open pdf in a new tab
*/
openPDFInAnNewTab: function() {
sap.m.URLHelper.redirect(this._generatePDFLink("Parameter"), true);
}
Related Information