Skip to Content

Binding $expand url to sap.m.Table

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 04, 2015 at 01:50 PM

    Hi Venkat,

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

    SAPUI5 Explored

    Regards,

    Jamie

    SAP - Technology RIG

    Add comment
    10|10000 characters needed characters exceeded

    • 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

  • Nov 05, 2015 at 06:04 AM

    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

    Add comment
    10|10000 characters needed characters exceeded