-4

I need to programmatically set text into TextBox and catch event when text was changed. How to accomplish this?

WelcomeTo
  • 18,613
  • 51
  • 157
  • 276

2 Answers2

1

Use setValue("my new value", true);? This will fire an ValueChangeEvent, which you can catch by adding a ValueChangeHandler.

Hilbrand Bouwkamp
  • 13,459
  • 1
  • 44
  • 52
0

You can use following

yourTextBox.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
     public void onValueChange(ValueChangeEvent<String> event) {
    // TODO Auto-generated method stub

     }
});
Rahul Borkar
  • 2,724
  • 2
  • 22
  • 38