Skip to Content
0

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

Jul 20, 2017 at 10:18 AM

134

avatar image
Former Member

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.

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

4 Answers

Sergio Guerrero Jul 20, 2017 at 10:25 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Sergio Guerrero Jul 20, 2017 at 10:25 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jul 21, 2017 at 09:11 AM
0

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 .

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 23 at 10:51 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded