tags:

views:

32

answers:

1

There is a similar question to this for ExtJS but not for GXT.

I wish to simply add an onclick handler to a TreePanel in GXT. That is, I wish to perform an operation when a user clicks on a node in the tree. The showcase does not seem to cover this most basic usecase.

Thanks,

A: 

Premature cry for help it seems.

This seems to do the trick:

        treePanel.addListener(Events.OnClick, new Listener<TreePanelEvent<ModelData>>() {
            public void handleEvent(TreePanelEvent<ModelData> be) {
                // do something here
            };
        });
Chris