I have a rather strange problem
When copying one WidgetCollectionfrom one FlowPanelto another. Widgetsin WidgetCollectionmove instead of copying. Because of this pair of widgets remain in the previous panel.
Here is my code:
final FlowPanel toDelete = getWidgetByID(from);
final FlowPanel toPaste = getWidgetByID(to);
final Iterator<Widget> iterator = toDelete.iterator();
while (iterator.hasNext()) {
toPaste.add(iterator.next());
}
and the next version:
final FlowPanel toDelete = getWidgetByID(from);
final FlowPanel toPaste = getWidgetByID(to);
final int count = toDelete.getWidgetCount();
for (int i = 0; i < count; i++) {
toPaste.add(toDelete.getWidget(i));
}
What is wrong here? Thanks in advance.
Õzbek source
share