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.

Vaadin 8 Binding Custom Business Object to CheckBoxGroup

René Wilby
5 years ago Apr 10, 2017 10:38am
René Wilby
5 years ago Apr 10, 2017 11:01am

Answering my own question (-.-):

The class Tag needs to overrid the method equals. Here is the complete Class:

package com.vaadin.test;

public class Tag {

    private String name;

    public Tag(String name) {
        super();
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return name;
    }

    @Override
    public boolean equals(Object obj) {
        return ((Tag) obj).getName().equals(this.getName());
    }
}