The basics is that im creating a very basic SAP Fiori app that displays data from a table as it loads. There are 2 tables in the database that the SAPUI connects to, and i want to change view and controller at the press of a header toolbar. The visual part of this header toolbar has been implemented, and it calls for the function that i want to use to switch views and controllers while giving it the Key var that will be used to pick one or the other using a Switch.
Then… What?
Every time i google a solution about how to make a button that gets another view or another controller it doesn’t work. There’s no exception to catch, the console just says “empty string being passed to getelementbyid()”. I have made a succesful switch to another view and another controller when i passed the ID of a row of the table, however what i want to do isn’t to pick a specific ID but rather do another “get” in the other controller.
Could anyone guide me in the right direction?
` onTabSelect: function (oEvent) {
var sKey = oEvent.getParameter("key");
try{
switch (sKey) {
case "Main":
this.getRouter().navTo("Main");
break;
case "Main2":
this.getRouter().navTo("Main2");
break;
default:
break;
}
}catch (error){
console.log(error);
}
} `
I need a succesful change of view and controller to “Main2”
user24945364 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.