I’m trying to implement a screen with a listview that the user will use to select several options.Each “item” can have 1 of 3 options selected, so I thought the most appropriate component to use was the “SegmentedBar” component.
The listview displays perfectly but once you scroll and a new item is about to become visible I get the error "Error: View already has a parent. View: [object Object] Parent: SegmentedBar(252).
I suppose this is happening due to the template recycling happening, but have no idea how to solve it… Any ideas/guidance?
Code fragment:
<ListView [items]=“recipe” class=“list-group”>
<GridLayout rows="" columns=",200" width=“500” class=“list-group-item” [id]=“i” [class.disabled]=“ingr.avl==0” [visibility]=“ingr.avl>0 ? ‘visible’ : ‘collapsed’”>
<Label [text]=“ing(ingr.iid,‘dsc’)” fontsize=“12” fontweight=“bold” backgroundcolor="#ffffff" row=“0” col=“0” style=“text-align:left”>
<SegmentedBar #optbar [items]=“ingr.optOptions” [selectedIndex]=“ingr.optSel” (selectedIndexChange)=“onOptSel($event, i)” style=“align-content: right” row=“0” col=“1”>