Select multiple items in table programmatically

Well I’m sorry the problem was multiselect was set to false… But I couldn’t figure out how to delete my post from this forum…

ArrayList<EventCard> ecs = new ArrayList<>();
for (WorkGroup w : groupsTbl.getSelected()) {
    for (Card c : wGroupsCards.getFirst(w)) {
        ecs.add(cardsToEventCards.get(c));
    }
}
cardsTbl.setSelected(ecs);

Despite the fact that ecs contains 2 items (and setSelected has signature void setSelected(Collection<E> items)) ,only first one gets selected
In cuba-web-6.9.6-sources.jar!/com/haulmont/cuba/web/gui/components/WebAbstractList.java
setSelectedIds(itemIds); gets executed and itemIds also contains 2 items…
Why only first one gets selected?

Well I’m sorry the problem was multiselect was set to false… But I couldn’t figure out how to delete my post from this forum

1 Like

Hello @rulesprog

Your question is a real case and it can help other users, so there’s no need to delete the topic.

Regards,
Daniil.