Skip to Content
0

SAPUI5 Array of array presentation. Double Items aggregation

Dec 15, 2016 at 02:17 PM

85

avatar image

Hello all,

A have a data organized as a tree, in first level I have a parent, on the second - it's children

I need some control/controls to present such a data

For example <Flexbox> has an items aggregation, so I can present all parents

Each parent has a list of children. Something like the next:

When I'm trying to use any items aggregation control, like another Flexbox or table, i'm receiving the next error :

sapui5.hana.ondemand.com/1.40.12/resources/sap-ui-core.js:160 2016-12-15

16:13:44.684850 During a clone operation, a template was found that neither was marked with 'templateShareable:true' nor 'templateShareable:false'. The framework won't destroy the template. This could cause errors (e.g. duplicate IDs) or memory leaks (The template is used in aggregation 'columns' of object '__table2').For more information, see documentation under 'Aggregation Binding'. -

Can you suggest any other way to reach two <items> aggregations one inside other?

The example:

<FlexBox

direction="Column"

alignItems="Start"

items="{ path: 'model>/parents' }">

<items>

<Text text="{model>name} {model>version}" ></Text>

<FlexBox

items="{ path: 'model>children' }">

<items>

<Image src="{ path: 'model>src',

formatter: '.formatter.imageformat' }"/>

</items>

</FlexBox>

</items>

</FlexBox>

Thanks

Maya

untitled.png (4.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Radek Chudziak Dec 15, 2016 at 04:07 PM
0

Try the Tree container or the Tree Table

Show 1 Share
10 |10000 characters needed characters left characters exceeded

I need to get something like this:

So Tree table or StandardTreeItem can't help here cause I need different behavior for parent and children items

Children supposed to be a horizontal list of images, if I imagine the table - the number of children is a number of columns

and all this supposed to be inserted into one row

untitled.png (4.8 kB)
0
Sergio Guerrero Dec 15, 2016 at 09:55 PM
0

what if you had a horizontal layout:

https://sapui5.netweaver.ondemand.com/sdk/explored.html#/entity/sap.ui.layout.HorizontalLayout/aggregations

then via JavaScript, onBeforeRendering(), you could add the content from your model (children) - for each children, you can add a control into the content aggregation.

hope this helps

--- edited:

here is the view

the controller

and how it looks - after here you will need to play with CSS ...

if you have an array.. then you can read the array in a for loop and create and add the controls.

good luck!


viewimg.png (28.9 kB)
controllerimg.png (33.3 kB)
uiimg.png (15.5 kB)
Share
10 |10000 characters needed characters left characters exceeded