on 08-26-2015 1:26 PM
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
Why did you redefine the navTo method?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Plunker may be?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sascha,
write this event in your detail controller.
this.getView().addEventDelegate({
onBeforeShow: function(evt) {
rendring code for your UI.
} });
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.