$(function () { pageContext.i18n.modTalk = 'moderation talk'; pageContext.i18n.replyToComment = 'Reply'; pageContext.i18n.modTalkEmpty = 'moderation talk is empty'; pageContext.url.getModTalk = "/comments/%25ID%25/listModTalk.json"; pageContext.url.possibleCommentRecipients = "/comments/%ID%/possibleRecipients.json"; pageContext.url.commentEdit = '/comments/%25ID%25/edit.html'; pageContext.url.commentView = '/comments/%ID%/view.html'; pageContext.i18n.commentVisibility = { 'full': 'Viewable by all users', 'op': 'Viewable by the original poster', 'mod': 'Viewable by moderators', 'opAndMod': 'Viewable by moderators and the original poster', 'other': 'Advanced visibility', 'dialogTitle': 'Comment visibility', 'selectGroups': 'Visible to groups', 'selectOther': 'Other recipients', 'selectOriginalPoster': 'Original poster', 'selectModerators': 'Moderators', 'selectAssignees': 'Asked to answer users' }; pageContext.i18n.commentMenuLabels = { 'comment-edit': 'comments.menu.edit', 'comment-delete': 'comments.menu.delete', 'comment-convert': 'comments.menu.convert' };pageContext.i18n.answer= { bestAnswer: 'Best Answer', controlBar : { accept: 'Accept', unaccept: 'Unaccept', acceptCommand: 'Accept this answer as correct', cancelAcceptedCommand: 'Remove this answers accepted status' } }; window.croles = { u: false, op: false, m: false, og: false, as: false, ag: false, dc: false, doc: false, eo: false, ea: false }; tools.init({ q: { e: false, ew: false, eo: false, r: false, ro: false, d: false, dow: false, fv: false, c: false, co: false, p: false, tm: false , ms: false, mos: false }, n: { f: false, vf: false, vfo: false, vr: true, vro: true, c: false, co: false, vu: false, vd: false, w: false, wo: false, l: false }, c: { e: false, eo: false, d: false, dow: false, ta: false, tao: false, l: false }, a: { e: false, ew: false, eo: false, d: false, dow: false, a: false, aoq: false, ao: false, tc: false, tco: false, p: false, tm: false }, pc: croles }, { tc: true, nsc: true }); commandUtils.initializeLabels(); }); Skip to Content
avatar image
Former Member

How to get the Expand parameters from Master to Detail page?

Hello All,

I face an issue with one of the Master-Detail app developed using the oData services.

Master view list items are binded with "/Products" with Expand to navigation properties "toSupplier,toContent".

Now, using the router mechanism I have passed the path of the selected product via Parameter to detail view. Read the path in the detail view controller and bound the Object Header with this path to display the same details. I have few tabs under the Object header displaying Supplier and Content Details. Under these tabs while I refer to the relevant fields as "{toSupplier/SupplierID}" or "{toConent/ContentID}" is not displaying any data.

As per my understanding, I noticed the oData available in the Master View, but the same is not available in Detail view.

Can you please suggest on how to get the data binding with expand parameters available to detial view?



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Nov 15, 2016 at 03:55 PM

    code please

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 15, 2016 at 10:59 PM

    Hello Jun Wu,

    Here is the code snippet

    Master View :-

    <List id="slist" items="{ path: '/shopping_cartSet', parameters: { expand: 'ToVendor,sc_to_tech_specs,sc_to_contents' } }" >

    <StandardListItem title="{Zpname}" description="{Zcategory}" type="Active" press="onPress"></StandardListItem>


    Master Controller:-

    onPress: function (oEvent){

    var oSource = oEvent.getSource(); var oContext = oSource.getBindingContext().getPath();

    var oRouter = sap.ui.core.UIComponent.getRouterFor(this); var oModel = this.getView().getModel();

    oRouter.navTo( "object", {Path : oContext.substring(1)}); }

    Detail View:-

    <IconTabBar id="TabBar">


    <IconTabFilter text="Tech.Specs" id="Tech">

    <l:VerticalLayout> <Label text="Model"/> <Text text="{sc_to_tech_specs/Zmodel}"/> <Label text="Make"/> <Text text="{sc_to_tech_specs/Zmake}"/> </l:VerticalLayout>


    <IconTabFilter text="Contents"> <l:VerticalLayout> <Label text="Model"/> <Text text="{sc_to_contents/Zmodel}"/> <Label text="Make"/> <Text text="{sc_to_contents/Zmake}"/> </l:VerticalLayout>



    Detail Controller:-

    _onObjectMatched: function(oEvent){

    var oPath = oEvent.getParameters().arguments.Path; var oContext = oEvent.getSource().oBindingContexts; var oBject = this.getView().byId("OBH"); var oTab = this.getView().byId("Tech"); oBject.bindContext("/" + oPath); oTab.bindContext("/" + oPath); }


    { "pattern": "Objects/{Path}", "name": "object", "target": ["master", "object"] }


    "object": { "viewName": "Detail", "viewId": "detail", "viewLevel": 2 },

    Hope these snippets provide you a good information.



    Add comment
    10|10000 characters needed characters exceeded