cancel
Showing results for 
Search instead for 
Did you mean: 

How to navigate to another view by clicking on tile container ?

Former Member
0 Kudos

Hi All,

I am trying to navigate to another view by clicking on tile container.

Please find the code below:

firstscreenController.js:

var oTileContainer = this.getView().byId("container");

//Get Genetared Tile IDs

oTileContainer.addEventDelegate

({ onAfterRendering: function()

{ //Get Aggregation Tiles of tile container

var oTiles = tileContainer.getAggregation("tiles");

//First Tile var oApproveTile = oTiles[0].getId(); sap.ui.getCore().byId(oApproveTile).attachPress

( function() {

name="157";

alert(name);

var oRouter = sap.ui.core.UIComponent.getRouterFor(oController); this.oRouter.navTo("secondscreen",{name: name}); }); }

Till alert , the code is working fine , but after that i m getting navTo undefined error.

Please suggest.

Accepted Solutions (0)

Answers (4)

Answers (4)

gururajenamate
Explorer
0 Kudos

Replace below routing code:

this.getOwnerComponent().getRouter().navTo("secondscreen",{name: name}); 

with:

var oRouter = sap.ui.core.UIComponent.getRouterFor(oController); 
this.oRouter.navTo("secondscreen",{name: name}); 

Regards,

Gururaj

Former Member
0 Kudos

Hi Sergio,

Thanks for the response.

I tried the usual routing code, it doesn't work for me when i try to navigate to another view by clicking on tile .Please suggest .

SergioG_TX
Active Contributor
0 Kudos

HI Lalitha -

this is where you can find the router documentation

https://sapui5.hana.ondemand.com/explored.html#/sample/sap.ui.core.sample.RoutingFullscreen/code

the question should be whether or not your views are defined ? if so, then make sure your view names are set up correctly.

SergioG_TX
Active Contributor
0 Kudos

HI Lalitha -

this is where you can find the router documentation

https://sapui5.hana.ondemand.com/explored.html#/sample/sap.ui.core.sample.RoutingFullscreen/code

the question should be whether or not your views are defined ? if so, then make sure your view names are set up correctly.