I have both my apps in the FLP. At present I am sending only limited data so I am able to send it by appending it to URL. I would like to change this and send an array. I tried using AppState but it does not seem to work and I could not find an example with the new UI5 version (1.120.9) Could someone please help me with this?
Thank you!
Container.getServiceAsync("Navigation").then((oCrossAppNavigator) => {
oCrossAppNavigator.getHref({
target: { shellHash: 'xyz + plant=$plant' + material + ... }
}).then((hash) => { if (navigationOption === "newTab") {
let URLHelper = library.URLHelper;
URLHelper.redirect(hash, true); }
else {
oCrossAppNavigator.navigate({
target: {shellHash: hash}
});
My current implementation is above.
This is what I tried
sap.ushell.Container.getServiceAsync("CrossApplicationNavigation").then((oCrossAppNav) => {
const oAppState = oCrossAppNav.createEmptyAppStateAsync(this);
oAppState.setData(arrayData);
oAppState.save();
oCrossAppNav.getHrefForAppSpecificHash('xyz&sap-iapp-state=${oAppState.getKey()}')
.then((hash) => {{ if (navigationOption === "newTab") {
let URLHelper = library.URLHelper;
URLHelper.redirect(hash, true); }
else {
oCrossAppNavigator.navigate({
target: {
shellHash: hash
}
});
2
Answers
Added this
before
Container.getServiceAsync("Navigation").then((oCrossAppNavigator) => {
A URL has a length limitation, so passing an array in it is not a good option.
You could try storing your array in the localStorage.