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.

How to disable Tree node expand/collapse functionality

Timo Ratilainen
1 decade ago Mar 04, 2011 11:53am
Timo Ratilainen
1 decade ago Mar 08, 2011 8:53am
Marko Grönroos
1 decade ago Mar 08, 2011 10:00am

The trivial solution is to add a Tree.CollapseListener to the tree and when a collapse occurs, undo it.

tree.addListener(new Tree.CollapseListener() {
    public void nodeCollapse(CollapseEvent event) {
        // Re-expand the collapsed item
        tree.expandItem(event.getItemId());
    }
});
Last updated on Mar, 8th 2011
Joonas Lehtinen
1 decade ago Mar 08, 2011 3:56pm
Timo Ratilainen
1 decade ago Mar 09, 2011 10:20am
Timo Ratilainen
1 decade ago Mar 09, 2011 10:33am
Marko Grönroos
1 decade ago Mar 09, 2011 1:10pm
Faras Khan
6 years ago Dec 13, 2016 6:46pm
Olli Tietäväinen
6 years ago Dec 14, 2016 5:32am
Faras Khan
6 years ago Dec 15, 2016 1:14pm
Olli Tietäväinen
6 years ago Dec 15, 2016 2:10pm