Hi Team,
I am facing an issue when user press browser refresh button. My app is a splitapp which has three navigation from home screen. When User navigated to third screen, they are selecting the browser refresh button. Now, when they go to home screen by selecting browser back button, data presented in the view are empty. How can I restrict user from selecting the browser refresh. Is this a basic behavior of an app? How to overcome this issue?
Regards
Karthik S
Request clarification before answering.
This is a general issue when you use routing with hash. As you are in the 3rd view and refresh the page, the hash will be there and the page gets refreshed and this is where you need to read the routing parameter(hash) in the routeMatched event and re read the data if not found(in case of browser refresh) which is the recommended way.
Try generating a master detail app using the ui5 template and you can see this feature in action which uses promises to achieve this.
restricting browser refresh is not an option. but you can still show a message to user if t he user refreshes but this will not prevent the refresh as it's just an information message and user can override it.
Thanks,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am using Routing navigation only. My previous view model or component model are empty when I try to refresh my third view. I am looking for a solution where user has to be navigated to home screen when he refresh the third screen.
Hi Karthik S
If that is the case, then check in routematched event handler method if the data is there or not and you can trigger navigation again to the home page.
But it also looks like you dont' need routing as routing is needed in the scenarios when user clicks on refresh button and instead of navigating to the home page you will show the same page by requesting the new data.
So if you don't want that then better don't use navigation or don't use route patterns, just display page by using targets(without changing the hash).
https://ui5.sap.com/#/topic/d9efab307ecc42b180b12cc8956e22d7
Thanks,
Mahesh
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.