Skip to Content
avatar image
Former Member

SAPUI5 Array of array presentation. Double Items aggregation

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Dec 15, 2016 at 04:07 PM

    Try the Tree container or the Tree Table

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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)
  • Dec 15, 2016 at 09:55 PM

    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!

    Add comment
    10|10000 characters needed characters exceeded