Hi,
I am adding a new view to a FIori App. I have extended the App and created the view/controller as shown below. From the List screen I am trying to launch my new View passing a parameter.
newView.view.xml
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core"><Label text="My New Screen" /></core:FragmentDefinition>
newView.controller.js
sap.ca.scfld.md.controller.BaseDetailController.extend("cus.crm.mycalendar.CUST_CRM_MYCAL_EXT.view.newView", { onInit : function(){ var view = this.getView(); this.oRouter.attachRouteMatched(function(oEvent) { if (oEvent.getParameter("name") === "myDetail") { var context = new sap.ui.model.Context(view.getModel(), '/' + oEvent.getParameter("arguments").contextPath); view.setBindingContext(context); } }, this); }, }
);Enhanced the click method in the Controller of the Standard List screen as follows. I have created a custom controller which will override the method
onAppointmentClicked : function(oEvt) { var bc = oEvt.oSource.getBindingContext().getPath(); var sUUID = this.oModel.getProperty(bc).Guid; this.oRouter.navTo("myDetail", { objectsID : sUUID });I have put the below routing logic in the component.js file of my extended project (right below the config:)
routing : {"routes" : {"masterDetail" : {"subroutes" : {"master" : {"subroutes" : { //Navigation details goes here "myDetail" : { "pattern" : "myDetail/{objectsID}", "viewPath":"cus.crm.mycalendar.CUST_CRM_MYCAL_EXT.view", "view" : "newView", "targetAggregation":"detailPages", "viewLevel" : 2 }}}}}}},When I click on the item in the list, nothing happens. I am expecting a navigation to my new view.
Any suggestions.
Thanks
Murali