on 07-20-2017 11:18 AM - last edited on 02-03-2024 9:13 PM by postmig_api_4
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.