Forum

Ralf Hader
      4 years ago #19489
      Up
      1
      Down
      ::

      Ok, this Script works,

      document.addEventListener("backbutton", onBackKeyDown, false);
      
      function onBackKeyDown() {
          var curr_page = sap.ui.getCore().byId("Application").getCurrentPage();
          console.info(curr_page.getId());
          if (curr_page.getId() === "PAGE1") {
              console.info('close pressed');
              window.navigator.app.exitApp(); // OK
          } else {
              console.info('back pressed');
              // window.navigator.app.backHistory(); // <no action
              this.navBack(); // Uncaught TypeError this.navBack is not a function
              // window.navigator.app.navBack();  // Uncaught TypeError window.navigator.app.navBack is not a function
          }
      
      }
      

      but this.navBack(); and the other variations doesn´t.
      Any Idea why?