0

I want to close an UI5 app by pushing the navigation button. Is this possible ?

Btw: How can I close the app by not closing the tab?

Thanks

Mario
  • 43
  • 5
  • 13
  • What do you mean with closing an UI5 app? – matbtt Mar 08 '17 at 18:27
  • I start the app rom the launchpad a new tab in the explorer start. Is it possible to close it manually, not by clicking the X in the tabbar =? – Mario Mar 09 '17 at 11:57

1 Answers1

2

Because the app is in fact a "simple" web page, the concept of closing it is somewhat loose. Some ideas that you could try, depending on what you want to achieve:

  • Try and close the tab, but this will generally not work, because you can only close tabs that you created yourself (see Close Current Tab).
  • Open the blank page by using window.open("about:blank", "_self");
  • Open the home page of the browser by using window.home(); (see Sending user to their browser's Home Page using Javascript)
  • Trigger a "Back" navigation outside of your app (such that the page that was open before your app will be shown). You can use window.go(steps) to go forward / backward in the browser history by a number of steps (negative indicates that you are going backwards). It might be tricky to get the correct number of steps that you have to go back if you have hash-based routing in your app (you could use sap.ui.core.routing.History or a similar mechanism).
Community
  • 1
  • 1
Serban Petrescu
  • 5,127
  • 2
  • 17
  • 34