How to add ValueChangeHandler to Tree?

12 views
Skip to first unread message

membersound

unread,
Jan 8, 2013, 6:01:33 AM1/8/13
to google-we...@googlegroups.com
Hi,

as far as I can see a GWT Tree has no ValueChangeHandler by default (for modifying elements in the tree).
Therefore I'm trying to extend the Tree and add a ValueChangeHandlermy myself. But it never get's called:

class MyTree extends Tree implements ValueChangeHandler<String> {

    //never gets called
    @Override
    public void onValueChange(ValueChangeEvent<String> event) {
        System.out.println("value changed");
    }
}


What's wrong here?

I'm changing the trees' content with:
@UiBinder
TextBox box;


@UiBinder
Button save;

@UiHandler("save") {
void onSave(ClickEvent evt) {
  tree.getSelectedItem().setText(box.getText());
}


From debugging I can see that the value in the tree items is already changed by this! But it is not reflected in the tree in GUI. So I probably have to write something in the onChangeHandler to update the tree visually.
But as I said, onValueChange never gets called...
Reply all
Reply to author
Forward
0 new messages