Skip to Content
0

Back button to Fiori Launchpad does not work

Nov 15, 2016 at 10:27 AM

351

avatar image

After clicking on the back button I'm getting error in the developer console:

[index.html] the URL is not compliant and may break in a future version


onNavBack: function() {
	var oHistory = sap.ui.core.routing.History.getInstance(),
	    sPreviousHash = oHistory.getPreviousHash(),
	    oCrossAppNavigator = sap.ushell.Container.getService("CrossApplicationNavigation");


			if (sPreviousHash !== undefined) {
				// The history contains a previous entry
				history.go(-1);
			} else {
				// Navigate back to FLP home
				oCrossAppNavigator.toExternal({
					target: {
						shellHash: "#"
					}
				});
			}
		}

index.html

<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		
		<title>Quality Notification N1</title>
		
		<script src="resources/sap/ushell_abap/bootstrap/abap.js"></script>
		
		<script id="sap-ui-bootstrap"
			src="resources/sap-ui-core.js"
			data-sap-ui-libs="sap.m, sap.ushell, sap.collaboration"
			data-sap-ui-theme="sap_bluecrystal"
            data-sap-ui-xx-supportedLanguages="en"
            data-sap-ui-xx-bindingSyntax="complex"
			data-sap-ui-compatVersion="edge"
			data-sap-ui-resourceroots='{"ZPS1_QM_N1": "./"}'>
		</script>
		
		<script>
		
           sap.ui.getCore().attachInit(function() {
                new sap.m.Shell({
                    app: new sap.ui.core.ComponentContainer({
                        height : "100%",
                        name : "ZPS1_QM_N1"
                    })
                }).placeAt("content");
            });
					
        </script>
	</head>
	<body class="sapUiBody" id="content" rootUiArea >
	</body>
</html>
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Tom Parsons Apr 27, 2017 at 02:21 PM
0

Hi Matthias,

Some questions;

  1. Are you launching your app from the Launchpad?
  2. Do you have routing within your app that changes the hash?
  3. Have you debugged the onNavBack function to see if sPreviousHash is defined?
  4. Have you inspected the history object to see what's there?
Share
10 |10000 characters needed characters left characters exceeded