docs

Lifecycle of Binding Templates

The lifecycle of the binding templates differs from the lifecycle of controls that are contained in an aggregation. Whenever a control object is destroyed, any aggregating object is destroyed as well. For list binding templates, you specify the behavior by using the additional property templateShareable in the parameter of the bindAggregation method of class sap.ui.base.ManagedObject.

Caution:

Leaving the templateShareable parameter undefined is highly error-prone! We recommend always setting this parameter explicitly to true or false.

In XML views, you can also use the templateShareable property by adding it to the binding info as follows:

<Table id="EmployeeEquipments" headerText="Employee Equipments" items="{
    path: 'EMPLOYEE_2_EQUIPMENTS',
    templateShareable: false
}">
    <columns>
        <!-- ... -->
    </columns>
    <items>
        <ColumnListItem>
            <cells>
                <Text text="{ID}"/>
            </cells>
            <cells>
                <Text text="{EQUIPMENT_2_PRODUCT/Name}"/>
            </cells>
            <cells>
                <Text text="{Category}"/>
            </cells>
            <cells>
                <!-- Name="PRODUCT_2_CATEGORY" Type="Collection(...)" -->
                <List items="{
                    path: 'EQUIPMENT_2_PRODUCT/PRODUCT_2_CATEGORY',
                    templateShareable: true
                }">
                    <StandardListItem title="{CategoryName}"/>
                </List>
            </cells>
            <cells>
                <Text text="{EQUIPMENT_2_PRODUCT/PRODUCT_2_SUPPLIER/Supplier_Name}"/>
            </cells>
        </ColumnListItem>
    </items>
</Table>