Skip to Content

SAPUI5: How to bind a node structured XML model to sap.ui.table?

Hi,

I'm having trouble binding a node structured XML model to a table.The requirement is to bind all the "calculatedVolumesData" elements from the following structure to a table. When I bind the rows to /billingRequest/calculatedVolumesData, only the first 3 records come up. When I change the structure and remove the "billingRequest" element, then all the records come up. So, it seems like only a flat structure is supported? Is it somehow possible to achieve my goals without changing the structure of the model?

<billingRequest id="10158">
  <calculatedVolumesData>
     <rateCategory>AMR-WV1_1</rateCategory>
     <calculationOperations>Off Cycle</calculationOperations>
     <fromDate>2017-03-31T22:00:00Z</fromDate>
     <toDate>2017-04-29T22:00:00Z</toDate>
  </calculatedVolumesData>
  <calculatedVolumesData>
     <rateCategory>AMR-WV1_2</rateCategory>
     <calculationOperations>Off Cycle</calculationOperations>
     <fromDate>2017-03-31T22:00:00Z</fromDate>
     <toDate>2017-04-29T22:00:00Z</toDate>
  </calculatedVolumesData>
  <calculatedVolumesData>
     <rateCategory>AMR-WV1_3</rateCategory>
     <calculationOperations>Off Cycle</calculationOperations>
     <fromDate>2017-03-31T22:00:00Z</fromDate>
     <toDate>2017-04-29T22:00:00Z</toDate>
  </calculatedVolumesData>
</billingRequest>
<billingRequest id="10504">
  <calculatedVolumesData>
     <rateCategory>2_1</rateCategory>
     <calculationOperations>Off Cycle</calculationOperations>
     <fromDate>2017-03-01T05:00:00Z</fromDate>
     <toDate>2017-03-20T05:00:00Z</toDate>
  </calculatedVolumesData>
  <calculatedVolumesData>
     <rateCategory>2_2</rateCategory>
     <calculationOperations>Off Cycle</calculationOperations>
     <fromDate>2017-03-01T05:00:00Z</fromDate>
     <toDate>2017-03-20T05:00:00Z</toDate>
  </calculatedVolumesData>
  <calculatedVolumesData>
     <rateCategory>2_3</rateCategory>
     <calculationOperations>Off Cycle</calculationOperations>
     <fromDate>2017-03-01T05:00:00Z</fromDate>
     <toDate>2017-03-20T05:00:00Z</toDate>
  </calculatedVolumesData>
</billingRequest>
Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Sep 08, 2017 at 12:08 PM

    it depends of how you want to expose your data... if you use a table, of course it will show you up a flat structure. if billingRequest is not relevant four your user, you have to modify your structure otherwise, you can use a Master/detail application. in master data you set the billingrequest and in the detail the calculatedVolume data.

    Add a comment
    10|10000 characters needed characters exceeded

    • I'm using an existing service and changing the structure in the back-end is not desirable as the same service is used by other applications. I could change the structure in the client side but, this seems to me like a workaround rather than a good solution. I tried using XPath in the binding path but that also didn't work.

  • Posted on Sep 08, 2017 at 01:31 PM

    seems not likely....

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 09, 2017 at 04:06 AM

    seems weird, can you share your code in jsbin or plunkr?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.