cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Destinations in Widgets

0 Kudos

My goal is to convert an SAPUI5 app which uses an OData Service to a Wdiget and use this Widget in the Portal Service.

i followed the following Tutorial which worked so far. I can insert the widget into my Freestyle Site in my Portal Service. The Site is shown but my table shows no Data. The OData Request returns "404 not found". I assume that the destinations of the original app haven't been added to the widget.

What is the best practice here?
Do i have to add a destination to the Freestyle Site? If yes, how?

Greetings
Oliver

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hi Oliver,

Destinations are used in the application lever, regardless of the portal framework, so you don't need to add them again.

One difference between running the application as a standalone application and running in in the portal context is the URL of the application - when the application runs inside the portal it is actually running in the URL of the portal, prefixed with /sap/fiori/<application-name>.

I assume that when your application tries to access the destination, it accesses "/destinations/<destination-name>/..." - and in the portal context, you need to add the /sap/fiori prefix as well.

This can all be solved by modifying the AJAX requests in your application to support both scenarios (with and without a prefix):

jQuery.get(jQuery.sap.getModulePath("<your-component-name>") + "/destinations/...")

This way, running as a standalone application, getModulePath will return "/", and running in the portal it will return "/sap/fiori/<application-name".

Regards,

Guy

Answers (0)