Distinction between ID and display name

Hi,

following the Tree example in the book of Vaadin, I can easily create a navigation tree. What I don’t like in the example that item ID and the menu items display name are basically the same. For example, this enforces uniqueness of display names. Additionally, I’d prefer to have my ID’s hard coded in the source code and to read the display names from a resource bundle.

Is it possible to have something like

    addItem(id, name)

Thanks,

Jochen

You can use setItemCaption(itemId, caption). That way, item ID s can be any objects and you can give any caption for the tree nodes.

You can use the method in the Select.ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID caption mode (which is the default). See
this example
.

Thanks, that worked nicely!