$(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: false, vro: false, 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

SAP Fiori CRUD Master-Detail Application Template - element binding issue

Hello,

I am trying to bind the label on the detail page within SAP Fiori CRUD Master-detail app:

DetailView.xml:

<Text text="First name:" id="txtTest"/>

with one record from ContactSet:

I am trying to display the FirstName of the very first record:

So it says First name: FirstName 1:

I did try to bind it as follows but this does not work:

DetailView.xml:<Text text="First name: {mainService>/ContactSet('76745721-b08d-4a4f-baab-bdaeeeff9d6e')/FirstName}" id="txtTest"/>

My datasource:

The whole project export is available here: Project export

Any help much appreciated!

Cheers

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Jan 20, 2017 at 05:17 PM

    The problem is now solved.

    The problem was in the XML annotation syntax. This is how it should have looked:

    {/ContactSet(guid'76745721-b08d-4a4f-baab-bdaeeeff9d6e')/FirstName}"
    

    All credit goes to Miguel Carrero.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 10, 2017 at 05:32 PM

    May be this can work?

    "mainService>/ContactSet/0/FirstName"?

    Can you show your Json?

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 11, 2017 at 09:16 AM

    Hi Krishna,

    "mainService>/ContactSet/0/FirstName" doesn't work.

    This is first record of the json file:

    {
    "Address":{
    "City":"City 1",
    "PostalCode":"PostalCode 1",
    "Street":"Street 1",
    "Building":"Building 1",
    "Country":"Country 1",
    "AddressType":"AddressType 1"
    },
    "ContactGuid":"76745721-b08d-4a4f-baab-bdaeeeff9d6e",
    "BusinessPartnerID":"BusinessPartnerID 1",
    "Title":"Title 1",
    "FirstName":"FirstName 1",
    "MiddleName":"MiddleName 1",
    "LastName":"LastName 1",
    "Nickname":"Nickname 1",
    "Initials":"Initials 1",
    "PhoneNumber":"PhoneNumber 1",
    "FaxNumber":"FaxNumber 1",
    "EmailAddress":"EmailAddress 1",
    "Language":"Language 1",
    "DateOfBirth":"/Date(1478856188000)/",
    "__metadata":{
    "uri":"ContactSet(guid'76745721-b08d-4a4f-baab-bdaeeeff9d6e')",
    "type":"/IWBEP/GWSAMPLE_BASIC.Contact"
    },
    "ToBusinessPartner":{
    "__deferred":{
    "uri":"ContactSet(guid'76745721-b08d-4a4f-baab-bdaeeeff9d6e')/ToBusinessPartner"

    }

    }

    }

    Add comment
    10|10000 characters needed characters exceeded