cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5: Structure for displaying Model Values in a Table.

former_member614481
Participant
253

Hello,

as the Title states, i do have a Model which does look as the following:

exampleModel = [0:{name: "Hallo Welt", number: 0}, 1:{name: "example", number: 1}]

I do have in the View - XML:

a defined Table with

<Table>  
  <columns> 
    <Column name="Name">
    </Column>

    <Column name="Number">
    </Column>  
  </columns>
</Table>

I would love to display the Values of exmapleModel for name, in the "Name" Column and number in the "Number" Column.

How do i do that?

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

You can do that by defining e.g. a JSONModel and using aggregation binding for your table. Please check the example here (you can switch to the code in the top right corner on that page).

For more details of course you can always check the official documentation at https://ui5.sap.com/ (search for binding in general and aggregation binding for your case).

former_member614481
Participant
0 Kudos

Thank you for the Answer and example. The examples look very detailed and awesome.

former_member614481
Participant
0 Kudos

I did it actually the very same way.

<items>
  <ColumnListItem>
    <cells>
      <Text text="{exampleModel>name}"/>
      <Text text="{exampleModel>number}"/>

    </cells>
  </ColumnListItem>
</items>

Doesn't seem to work?!

pfefferf
Active Contributor
0 Kudos

How did you set your model and with what name?

Answers (0)