cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 List / ViewRepeater alternative

pietrom_
Explorer
0 Kudos

Hello,
I'm developing an SAPUI5 Application to be deployed on a SAP BTP account.

I'm looking for a way to dynamically repeat multiple times a SAPUI5 Control (or composition of Control(s)), like the List or Table components does by using the aggregation "items".

I have a JSON model that has an array in it with multiple objects and I want to read the array and create a Control for every item of the array.

To achieve this, I've used the List element with a CustomListItem child object, but I need to find another way since the List object currently has issues being read by the JAWS screen reader (used by blind users).

I've seen the SAPUI5 API and I've found a sap.suite.ui.commons.RowRepeater/ViewRepeater that seems to fit the requirements, but it's deprecated since version 1.32 (I'm using version 1.84).

Is there an alternative way to achieve what I'm trying to achieve without resorting to write a custom SAPUI5 component 'from scratch'?

Thanks,
Pietro

Accepted Solutions (1)

Accepted Solutions (1)

TobiT
Participant
0 Kudos

Hi Pietro,

there are many other controls you can use. Basically everything with an aggregation taking all the controls you want to put inside.

Checkout the layouts namespace at: https://sapui5.hana.ondemand.com/#/api/sap.ui.layout

I like to use a VBox which is based on the FlexBox for simple vertical content:

<VBox itmes="{model>/aggregation}">
   <Button text="Hello World"/>
</VBox>

Cheers

pietrom_
Explorer
0 Kudos

Didn't know that FlexBox/VBox/HBox had an items property: I couldn't find it on the API reference nor the BAS (Business Application Studio) suggests it in the autocomplete!

Thank you.

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

how about flexbox

pietrom_
Explorer
0 Kudos

You're right, didn't know that. Unfortunately I can only set one accepted answer.

Thanks for helping!