Integrate Destinations
Overview
Destinations that are listed in the configuration
part of the manifest
should be resolved by the application with the help of sap.ui.integration.Host
.
The host application developer should set the resolveDestination
to a function, which
resolves destination name to the corresponding URL.
The card calls this function when it needs to send a request to the destination.
If a card depends on a destination, but this callback is not implemented, an error will be logged.
The callback receives destinationName
as parameter and returns a string with the URL.
Or alternatively the callback may return a Promise
which resolves with the URL as argument.
Example
Controllervar oHost = new sap.ui.integration.Host({ resolveDestination: function(sDestinationName) { switch (sDestinationName) { case "Northwind": return "https://services.odata.org/V3/Northwind/Northwind.svc"; // or with a promise return Promise.resolve("https://services.odata.org/V3/Northwind/Northwind.svc"); break; default: console.error("Unknown destination."); break; } } }); this.getView().byId('card1').setHost(oHost);XML View
<mvc:View xmlns:w="sap.ui.integration.widgets"> <w:Card id="card1" manifest="./manifest.json" /> </mvc:View>Try it Out