on 04-10-2019 2:39 PM
hello,
i am working on a master detail template using split app as a base.
i am using the toDetail method of o to navigate to detail page but i keep getting error saying Cannot read property 'toDetail' of undefined
App
<mvc:View controllerName="com.sap.build.standard.specialPriceApproval.controller.App" xmlns:mvc="sap.ui.core.mvc" displayBlock="true"
busy="{appView>/busy}" busyIndicatorDelay="{appView>/delay}" xmlns="sap.m">
<SplitApp id="idAppControl"/>
</mvc:View>
Master
onPress: function (oEvent) {
var that = this;
var obj = {};
var sToPageId = oEvent.getParameter("listItem").getProperty("title");
obj.reqNo = sToPageId;
that.byId("idAppControl").toDetail("detail1", "flip", obj);
}
Detail
oView.addEventDelegate({
onBeforeShow: function (oEvent) {
console.log(oEvent);
if (sap.ui.Device.system.phone) {
var oPage = oView.getContent()[0];
if (oPage.getShowNavButton && !oPage.getShowNavButton()) {
oPage.setShowNavButton(true);
oPage.attachNavButtonPress(function () {
this.oRouter.navTo("", {}, true);
}.bind(this));
}
}
}.bind(this)
how do i resolve this??
thanks and regards
Siddharth
so the issue got resolved.
the application needs a pattern that is configed in the manifest wherein you set the url pattern that you'll be using when calling the page and using that pattern the routing needs to be done and values need to be passed.
this blog here has the details related to the same :
thanks to everyone for your help 🙂
regards
Siddharth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
that.byId("idAppControl")
app is not part of your main view, that's why it failed
please use routing, not the ui element capability to do the navigation
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
check sap's routing example
https://ui5.sap.com/#/topic/1b6dcd39a6a74f528b27ddb22f15af0d
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.