navigation - Routing with parameter not working UI5 -
since days i`m stucked parameter based navigation overview- detailpage. navigation working fine values of detailpage not being displayed in detailpage (showobject). think somehow related binding in detail controller.
please find codesnippets attached:
manifest.json
"routes": [ { "pattern": "showobject/{code}", "name": "showobject", "target": "showobject" },
overview.controller.js triggered navigation clicking selecting line item , clicking on edit button. result value of column "code" (e.g. "abc").
oneditbuttonpressed:function() { var otable = this.getview().byid("idtable"); var ocode = otable.getselecteditem().getbindingcontext("model").getproperty("code"); var orouter = this.getownercomponent().getrouter(); orouter.navto("showobject", { code: ocode }); },
showobject.controller.js attach route pattern , set binding context
oninit: function() { var orouter = sap.ui.core.uicomponent.getrouterfor(this); orouter.getroute("showobject").attachmatched(this._onroutematched, this); }, _onroutematched: function (oevent) { var oview = this.getview(); oview.bindelement({ path: "/entity/" + "('" + oevent.getparameter("arguments").code + "')", model: "model" }); },
the console output of binding path is: /entities('abc')
to access single entity in browser following path required: https://domainname.com/service/service.svc/entities('abc')
the detailview contains simple text fields showing code.
<f:content> <label text="code"/> <text value="{code}"/> <label text="lastname" /> <text value="{lastname}"/> </f:content>
remark: odata service on version 4. in general i`m new topic, particulary routing ui5 have feeling issue caused binding path in showobject controller.
i checked other threads couldn`t find solution. has idea?
Comments
Post a Comment