Skip to Content
0

Routing issue while navigating back browser button

Jun 29, 2017 at 12:22 PM

51

avatar image

Hi All,

I am trying to implement Routing.

I have two views .In first view i have a table.When i click on table row then it navigates to other view and displays respective data,

Again when i click on Browser's back button it is navigating to the first view but the table is getting empty.

Could anybody please help em to solve this issue.

Regards,
Shekar.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Jun 30, 2017 at 12:50 PM
0

hi

Try this;

In manifest file or Component

	"sap.ui5": {
		"_version": "1.1.0",
		"rootView": "zhr_a.view.App",
		"dependencies": {
			"minUI5Version": "1.30",
			"libs": {
				"sap.m": {}
			}
		},
		"routing": {
			"config": {
				"routerClass": "sap.m.routing.Router",
				"viewType": "XML",
				"viewPath": "zhr_a.view",
				"controlId": "app",
				"controlAggregation": "pages",
				"transition": "slide"
			},
			"routes": [
				{
					"name": "teamOverview",
					"pattern": "",
					"target": "teamOverview"
				},
				{
					"name": "vertretungenn",
					"pattern": "ErfassungVertretungen",
					"target": "vertretungenn"
				},
		],
			"targets": {
				"teamOverview": {
					"viewName": "TeamOverview",
					"viewLevel": 1
				},
				"vertretungenn": {
					"viewName": "ErfassungVertretungen",
					"viewLevel": 2
				},


			}
		},

in first controller

		onPressVertretungErfaasen: function() {


			// Nav to ErfassungVertretung
			this.getOwnerComponent().getRouter().navTo("vertretungenn");

and to back

	onBack: function() {

			var sPreviousHash = History.getInstance().getPreviousHash();


			//The history contains a previous entry
			if (sPreviousHash !== undefined) {

				window.history.go(-1);
			} else {
				// There is no history!
				// replace the current hash with page 1 (will not add an history entry)
				this.getOwnerComponent().getRouter().navTo("teamOverview", null, true);
			}
		},


Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi eyup aksoy,

I Done in the same way but still am facing the same issue.

0