I want to implement this function, when I click on the button, the value of the button changes. But I know I cannot call the button object itself in its clickHandler. So, How can I do this?
button.addClickHandler(new ClickHandler(){
public void onClick(ClickEvent event){
button.getButtonElement().setValue("X");
}
});
2 ways:
Or
Outside the handler, use
Then you will be able to use btn as reference to the button inside the handler .