cancel
Showing results for 
Search instead for 
Did you mean: 

​SAP UI5 data binding sap.m.table

soni_minu
Explorer
0 Kudos

Hello Everyone,

Request your help on below problem statement:

I am using sap.m.table for UI. The desired format is as attached.

The links in details columns are coming in a string format separated using delimiter.

I am binding data dynamically on my page using bindAggregation and a template. I need help on how can I bind data for Details column.

Points to be taken care of:

  • Count of text and links pair should come dynamically.
  • Thus multiple link items have to be created corresponding to a single row.
  • On click of a row I need values from row to fetch exact URL.

Note: The format or patterns of Details column can be altered in back end but they will come in single field(single row).

Regards,

Minakshi

SergioG_TX
Active Contributor
0 Kudos

Minakshi,

what code have you tried?

here is the link to the documentation of the sap.m.Table control https://sapui5.netweaver.ondemand.com/#/entity/sap.m.Table

then within the table, on your template you may need a text formatter function as shown here

https://sapui5.netweaver.ondemand.com/#/sample/sap.m.tutorial.walkthrough.23/code/webapp%252Fmodel%2...

Accepted Solutions (0)

Answers (4)

Answers (4)

yogesh_beria
Explorer

You can instead use a factory function while binding where you can get the string data from the model and split it using the delimiter to get an array.

Then you can create the content dynamically in the function and return a layout control which has these items as an aggregation.

You can look at the links below for the factory function

https://sapui5.netweaver.ondemand.com/sdk/#/topic/335848ac1174435c901baaa55f6d7819

https://sapui5.netweaver.ondemand.com/sdk/#/topic/284a036c8ff943238fb65bf5a2676fb7

https://sapui5.netweaver.ondemand.com/sdk/#/api/sap.ui.base.ManagedObject/methods/bindAggregation

gururajenamate
Explorer
0 Kudos

Hi,

Add controls to the cell after u get data for the table.

Use HBox, VBox layouts to alight multiple value in same column.

Regards,

Gururaj

former_member227918
Active Contributor
0 Kudos

Hi,

you can use formatter function to format and put the count, check below example,

Example in fiddle

and i think you can get row value on row selection event further.

Sharathmg
Active Contributor
0 Kudos

When you bind the aggregation dynamically, use a local model to bind the data to your rows.

Populate the model, with the data you need to see on the table. Since it is data bound to control, you can have a separate method where the model is populated and it will be respectively updated on the view.

Regards,

Sharath