$(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

BindElement with $expand


Hi Experts.

I am doing a detail page. For the binding I executed the following

this.getView().bindElement("/DETAILSCollection(GUID='"+this.sMessageID+"',LANGUAGE='EN')?$expand=TEXT");

This call brings all the information related to a Message and also brings the different TEXTs linked to that message.

I can display the message info with no problem, but don't know how to display the Texts Info  for and specific textID (TDID =A002 only).  

Any one can help me out on the best approach..

<entry xmlns="http://www.w3.org/2005/Atom">
  <id>http://test.com:8000/ZSERVICE/DETAILSCollection(GUID='5999',LANGUAGE='')</id>
  <title type="text">DETAILSCollection(GUID='5999',LANGUAGE='')</title>
  <updated>2015-01-08T21:38:00Z</updated>
  <category term="ZSERVICE.DETAILS"/>
  <link href="DETAILSCollection(GUID='5999',LANGUAGE='')/TEXT" title="TEXT">
  <m:inline>
       <feed xml:base="http://test.com:8000/ZSERVICE/">
            <id>http://test.com:8000/ZSERVICE/DETAILSCollection(GUID='5999',LANGUAGE='')/TEXT</id>
                 <title type="text">TEXTCollection</title>
                 <updated>2015-01-08T21:38:00Z</updated>
                 <author><name/></author>
                 <link href="DETAILSCollection(GUID='5999',LANGUAGE='')/TEXT" rel="self" title="TEXTCollection"/>
                 <entry>
                      <id>http://test.com:8000/ZSERVICE/TEXTCollection('0001')</id>
                      <title type="text">TEXTCollection('0001')</title>
                      <updated>2015-01-08T21:38:00Z</updated>
                      <category term="ZSERVICE.TEXT"/>
                      <link href="TEXTCollection('0001')"/>
                      <link href="TEXTCollection('0001')/DETAILS"  title="DETAILS"/>
                      <link href="TEXTCollection('0001')/$links/DETAILS"/>
                           <content type="application/xml">
                                <m:properties>
                                     <d:TDID>0001</d:TDID>
                                     <d:TDTEXT>SY-SYSID</d:TDTEXT>
                                     <d:TDFUSER>JOHNDOE</d:TDFUSER>
                                     <d:TDFCREATED_AT>20141212181509</d:TDFCREATED_AT>
                                </m:properties>
                           </content>
                     </entry>
                      <entry>
                           <id>http://test.com:8000/ZSERVICE/TEXTCollection('A002')</id>
                           <title type="text">TEXTCollection('A002')</title>
                           <updated>2015-01-08T21:38:00Z</updated>
                           <category term="ZSERVICE.TEXT" />
                           <link href="TEXTCollection('A002')"/>
                           <link href="TEXTCollection('A002')/DETAILS" title="DETAILS"/>
                           <link href="TEXTCollection('A002')/$links/DETAILS" title="DETAILS"/>
                           <content type="application/xml">
                                <m:properties>
                                     <d:TDID>A002</d:TDID>
                                     <d:TDTEXT>testing this again</d:TDTEXT>
                                     <d:TDFUSER>JOHNDOE</d:TDFUSER>
                                     <d:TDFCREATED_AT>20141212181509</d:TDFCREATED_AT>
                                </m:properties>
                           </content>
                 </entry>
            </feed>
       </m:inline>
       </link>
       <content type="application/xml">
            <m:properties>
                      <d:GUID>5999</d:GUID>
                      <d:DESCRIPTION>test this</d:DESCRIPTION>
                      <d:CREATED_AT>20141212181512</d:CREATED_AT>
                      <d:CREATED_BY>JOHNDOE</d:CREATED_BY>
             </m:properties>
       </content>
</entry>
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Jan 09, 2015 at 06:11 AM

    You'll have to do,

    this.getView().bindElement("/DETAILSCollection(GUID='"+this.sMessageID+"',LANGUAGE='EN')", {expand:"TEXT"});
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 09, 2015 at 03:14 PM

    Maybe I didn't explain myself well. With this call

    http://test.com:8000/ZSERVICE/DETAILSCollection(GUID='"+this.sMessageID+"',LANGUAGE='EN')?$expand=TEXT

    I get all the properties related to a specific Message ID.   and by executing it with the $EXPAND  I get all the different TEXTs related to that Message ID.

    Now when I try display the information on the detail page. I get all info related to the MEssage ID properties but don't get the properties related to the $EXPAND=TEXT

    I am assuming that the the problem is because I have one Message ID but it can have more than one type of text assign to it. I tried to display the $Expand properties in a sap.m.list.  But still no success. 

    <Page>

      <ObjectHeader>

           <attributes>

              <ObjectAttribute title="Object ID" text="{OBJECT_ID}"/>

              <ObjectAttribute title="Description" text="{DESCRIPTION}" />

               <ObjectAttribute title="Created at" text="{CREATED_AT}"/>

            </attributes>

         </ObjectHeader>

         <List id="lText">

              <ObjectListItem id="oliText">

              <attributes>

                   <ObjectAttribute text="{TEXT/TDTEXT}" />

               </attributes>

               </ObjectListItem>

         </List>

    </Page>

    Rergards
    Henry Lopez

    Add comment
    10|10000 characters needed characters exceeded