Reputation: 1397
I am using GWT. I have a textbox and a drop down list box that have change handlers on them. I also sometimes change the text or selected value from the source code but I don't want the change handler to run when I do this, I only want it to run when the user changes it.
How can I implement this?
Upvotes: 1
Views: 234
Reputation: 3048
For the TextBox
, use setValue(T value, boolean fireEvents)
using false
as second argument, to avoid firing any ValueChangeEvent
.
For the ListBox
, when you call setSelectedIndex(int index)
or setItemSelected(int index, boolean selected)
the ChangeEvent
is never fired, so you are free to use them programmatically and rely on the ChangeHandler
on user action.
Upvotes: 3