Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Router.navTo doesn't trigger a change...

$
0
0

Hello Experts,

 

im using the Router-Mechanism in my Application. But when i use the "navTo"-Method of the router, my Splitapp adds the Detail-Page into the aggregation detailPages, but doesn't set the new detail page as current page.

 

My Question is now how is this possible?

 

See my routing configuration and how i implement the routing below:

 

routing     : {            config: {                routerClass      : mibs_portal.Router,                viewType         : "XML",                viewPath         : "mibs_portal.view",                targetAggregation: "content",                targetControl   : "Mobile--myShell",                clearTarget      : false            },            routes: [                {                    pattern           : ["", "main"],                    name              : "navMain",                    view              : "Main"                },                {      pattern    : "timesheet",  name              : "navTimesheet",      view              : "Timesheet",      subroutes         : [  {                                        pattern  : "timesheet/day/{newDate}",                                        name     : "navDay",                                        viewType : "XML",                                        view     : "Detail",                                        viewPath : "TimeSheet.view.TimeSheet",                                        viewId   : "Detail",                                        targetAggregation : "detailPages",                                        targetControl  : "v_TimeSheet--TimeSheet_App",                                        clearTarget       : false                                  }                                                           ]                  }                            ]        }

And the navTo-Implementation:

 

sap.ui.core.UIComponent.getRouterFor(sap.ui.getCore().byId("Mobile")).navTo("navDay", {newDate:aSelectedDates[0].getDate() + "-" +     (aSelectedDates[0].getMonth() + 1) + "-" +    aSelectedDates[0].getFullYear()}, bReplace);

And the "routePatternMatched"-Method in Detail Controller:

routeMatched : function(oRoute){  if(oRoute.getParameter("name") === "navDay"){  var sDate = oRoute.getParameter("arguments").newDate;  var dateArray = sDate.split("-");  var aDates = [];  aDates.push(new Date(parseInt(dateArray[2]), (parseInt(dateArray[1]) - 1), parseInt(dateArray[0]),0,0,0,0));  sap.ui.getCore().byId("Master--TimeCalendar").removeAllSelectedDates();  sap.ui.getCore().byId("Master--TimeCalendar").insertSelectedDate(new sap.ui.unified.DateRange({startDate:aDates[0]}), -1);  this.refresh(aDates);  }  },

 

 

After using navTo, i reach my "routePatternMatched"-Method in Detail-Controller. Everything works fine there. But on the splitapp the current page is still empty.

 

Has anyone an idea why?

 

 

Thanks for your Help!

Sascha


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>