cancel
Showing results for 
Search instead for 
Did you mean: 

Binding $expand url to sap.m.Table

venkatachala_ck
Active Participant
0 Kudos

Hi,

I am using below url

http://xxxxxxxxxxxxxxxxxxxxxx/sap/opu/odata/EMT/PMAPP_SRV/DeviceInfoCollection?

$filter=TransmitType%20eq%20%27LOAD%27&$e…

here DeviceInfoCollection is header,  Loadsettings and Refreshsettings are items

how to bind this to sap.m.Table

i tried using below code but i'm getting error in binding to Table

<Table selectionChange="index" id="ID_CAUSETABLE" inset="false" columns="{path : 'modelPersons2>/DeviceInfoCollection'  , parameters:{expand : 'Loadsettings'} }">
  <columns>
<Column id="col0">

</Column>
<Column id="col1">
<Text text="ID" />
</Column>
<Column id="col2">
<Text text="Supplier Name" />
</Column>
</columns>

    </Table>
   

Thanks

Venkat

Accepted Solutions (1)

Accepted Solutions (1)

jamie_cawley
Advisor
Advisor
0 Kudos

Hi Venkat,

You should be binding the items of the table.  You can find an example at

SAPUI5 Explored

Regards,

Jamie

SAP - Technology RIG

venkatachala_ck
Active Participant
0 Kudos

Hi Jamie Cawley,

The example which is there in SAPUI5 Explored is for individual url i mean they are not used expand property in that.

Can you give example which contains expand property and don't know how to use that expand keyword for my Url's

http:// xxxxxxxxxxxxxxxxxEMT/PMAPPSRV/EuipmentBomsCollection?$filter=TransmitType%20eq%20%27LOAD%27%20and%20User%20eq%20%27TESTUSER%27%20&$expand=EquipHeaders%2FEquipItems

for the above url  i tried like this but data is not displaying

items : { 

   path : "/EuipmentBomsCollection", 

   parameters : { 

    expand : "/EquipmentItem" 

   },

  factory : function(sId, oContext) { 

    var sContactTitle = oContext 

      .getProperty("EquipmentItem"); 

   

    return new sap.m.ColumnListItem(sId, { 

     cells : [ new sap.m.Text({ 

      text : "{Bom}" 

     }), new sap.m.Text({ 

      text : "{BomComponent}" 

     }), new sap.m.Text({ 

      text : "{CompText}" 

     })] 

    }) 

}

}

can you tel me what is wrong in this code.

Thanks & Regards

Venkat

Answers (1)

Answers (1)

karthikarjun
Active Contributor
0 Kudos

Hi Venkatachalam,

you can try this example.

oControl.bindElement("/Category(1)", {expand: "Products"});

oTable.bindRows({

  path: "/Products",

  parameters: {expand: "Category"}

});

Referred  from: Instantiating an OData Model - User Interface Add-On for SAP NetWeaver - SAP Library

Thanks,

KA