I need to navigate between the two views .The first view I had created is initial view and when I created the other view controller is also created which I dont need.If I delete the controller do it impact the other code.I want only one controller.
Moreover I am using the shell to display the view .I had done the entry for both the views in index.html as below:
<script>
sap.ui.localResources("navigation");
var app = new sap.m.App({initialPage:"idDisplayData1"});
var page = sap.ui.view({id:"idDisplayData1", viewName:"navigation.DisplayData", type:sap.ui.core.mvc.ViewType.JS});
app.addPage(page);
app.placeAt("content");
</script>
<script>
sap.ui.localResources("navigation");
var app = new sap.m.App({initialPage:"idDataNavigation1"});
var page = sap.ui.view({id:"idDataNavigation1", viewName:"navigation.DataNavigation", type:sap.ui.core.mvc.ViewType.JS});
app.addPage(page);
app.placeAt("content");
</script>
But how if I want to change the initial view How we do it.By using the shell Both views are displayed in same page when I am running the application as 'web as Preview'.I want that first a view is loaded than on button click the other view is loaded.