Skip to Content

Dynamic path for aggregation binding in XML view

Hi All,

Currently i am using odatamodel to retrieve data from hanaview with input parameter through odataservice.

I am able to retrieve data successfully with the below syntax with static values.

<Table id="table0" items="{br>/ViewParameters(Year='2017',Customer='ABCD')/Results}">

so my requirement is i need to pass those parameters values dynamically based on the tile which was i need to read the content of the tile and then pass those values to the items aggregation with the above syntax in XML view.

Please let me know how to achieve this.



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jul 27, 2017 at 04:56 PM

    Its possible to have dynamic path of aggregation using Javascript by creating a string of the path.

    var sYear = '2017';
    var sCustomer = 'ABCD';
    var sBindAggregationPath = "br>/ViewParameters(Year='" + sYear + "',Customer='" + sCustomer + "')";
    var oTable = this.getView().byId("table0");     //access table by id
    oTable.bindAggregation("items", {
            path: sBindAggregationPath,
            template:     <this needs to be ColumnListItem defined in XML>

    When using bind aggregation it is mandatory to provide 'template'

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 05, 2017 at 02:08 PM

    Hi srikanth,

    Thanks for your inputs. I am able to get the data with binditems instead of bindaggregation.

    I am trying your method as you mentioned above but i am unable to use template. How to assign columnlistitem which was defined in XML view to template..

    Could you please let me know.



    Add comment
    10|10000 characters needed characters exceeded