Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Own TwinColSelect with ListSelect

Patrick Lange
5 years ago Apr 26, 2016 8:36am
Olli Tietäväinen
5 years ago Apr 26, 2016 8:45am
Patrick Lange
5 years ago Apr 26, 2016 9:00am
Olli Tietäväinen
5 years ago Apr 26, 2016 9:30am

Hi,

the Item itself doesn't contain the caption. You could either read the caption from from the container, like you do when you initialize the left list, or from the left ListSelect object with getItemCaption(itemId). The second option would look something like this:

for (Object id : toAdd) {
      listRight.addItem(id);
      String caption = listLeft.getItemCaption(id);
      listRight.setItemCaption(id, caption);
}

-Olli

Patrick Lange
5 years ago Apr 26, 2016 10:13am