Sample code in "Section 5.15.1.Binding Selection Components to Data" of "Bo

I am reading the “Book of Vaadin” (Vaadin 7 Edition - 2nd Revision), and find out something is wrong in it.

In “Section 5.15.1.Binding Selection Components to Data” ==> “Item Captions” ==> “Caption Modes for Selection Components” ==> “ITEM_CAPTION_MODE_PROPERTY”


The sample code is:

/* A bean with a "name" property. */
public class Planet implements Serializable {
    String name;

    public Planet(String name) { = name;

    public void setName(String name) { = name;

    public String getName() {
        return name;

void propertyModeExample(VerticalLayout layout) {
    // Have a bean container to put the beans in
    BeanItemContainer<Planet> container =
        new BeanItemContainer<Planet>(Planet.class);
    // Put some example data in it
    container.addItem(new Planet(1, "Mercury"));
    container.addItem(new Planet(2, "Venus"));
    container.addItem(new Planet(3, "Earth"));
    container.addItem(new Planet(4, "Mars"));

The constructor of class Planet take only one parameter named “name”, but the code using this class is calling the constructor with 2 parameters.
I think this sample code is wrong.

And I check this code in the Book of Vaading editon 6.

It was:

container.addItem(new Planet("Mercury")); container.addItem(new Planet("Venus")); container.addItem(new Planet("Earth")); container.addItem(new Planet("Mars")); There was not the extra integer parameter in the calling of the constructor of class Planet.

Did the author of Edition7 want to demonstrate multi-properties of the Planet class, and simply forget to add a integer property to it (and also to its constructor)?

The book is under constant review.
Please file a ticket at for Documentation.

Hi, Felype.

Thanks for telling me that.
I am a new guy of this community.

I have created a new ticket: