cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with AppState in FIORI-App on Cloud Foundry

matthias_dichtl
Explorer
0 Kudos
220

Hello,

we have a CAP Application with a FIORI-App running on BTP (CloudFoundry).

The FIORI-App is a List-Report Page with some custom extensions. The share-Button works on Detail-/Object Page and at Search-Page it doesn´t work properly. The filter criterias where not shared. I think it has to do with an error i can see in console of the browser.
TypeError: s.storeInnerAppStateAsync is not a function.

Have someone this error too, and can someone give me a solution for it?
Maybe it's also related to the fact that the app doesn't run in FLP?

 

gregorw
Active Contributor
0 Kudos
Could you try to add the app to SAP Build Workzone and try again?
View Entire Topic
umasaral
Active Participant
0 Kudos

Hi

1. Check if Your App is Set Up for FLP-To ensure your app runs within the FLP:

Deployment: Make sure your app is deployed to the FLP environment and not running as a standalone application. This typically means it should be part of the Fiori launchpad's tiles or catalog.

Manifest Configuration: Check your `manifest.json` for the following:
sap.ui5 section should have the `crossNavigation` property set up to indicate the app can be navigated from the FLP.
SAP Fiori Launchpad Configuration: Ensure the app is configured correctly in the FLP's configuration settings.

Launchpad URL: Ensure that when you're accessing your app, you're using the FLP URL (like `https://<your-flp-host>/sap/bc/ui5_ui5/sap/<your_app>`) rather than a direct URL to the app.

2. Check App State Management Setup
To verify if app state management is correctly set up:

Router Configuration: In your `manifest.json`, ensure that the `sap.ui.generic.app` section is correctly configured. Look for:
`routing`: Check that routes and targets are defined properly.
`navigation`: Ensure that the `target` configurations are properly set up for navigating between views.

App State Handling:
In your controller (e.g., the List Report), ensure you are using the `storeInnerAppStateAsync` function where appropriate. This might look like this:
```javascript
onInit: function() {
// Store app state on initialization or relevant event
this.getOwnerComponent().getRouter().getRoute("yourRoute").attachPatternMatched(this.onRouteMatched, this);
},

onRouteMatched: function(oEvent) {
// Logic to store app state
let oAppState = {/* Your app state logic */};
this.getOwnerComponent().getAppStateManager().storeInnerAppStateAsync(oAppState);
}
```
State Retrieval: Make sure you have implemented the logic to retrieve and apply the stored state when the app initializes or the route changes.

Additional Tips:
Browser Console: Use the browser's console to check for any other errors or warnings that might give hints on why the function isn’t recognized.

Documentation: Consult the [SAP Fiori Elements documentation](https://ui5.sap.com/#/topic/9e2581ccbe6a4ef4a1a7a308cd06f6b7) for examples on implementing app state management effectively.

matthias_dichtl
Explorer
0 Kudos

Sorry, but to 1. in my initial post i wrote, that the app isn´t running in FLP. We have no chance to run in FLP because it is a side-by-side project on an old sap system. So maybe this is the problem, but i am not sure and i can not find something about. If you can confirm that is not working outside of flp it is ok for me and i will not spend more time in it.

2. is it mandatory to implement own logic for appstate handling? I will use the standard