mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-22 12:03:58 +00:00
add key up handler on suggest box created by DataEntryDialog to trigger validator
This commit is contained in:
1 parent
68974592b6
commit
5fa8464b9c
1 file changed
+14
@@ -12,6 +12,8 @@ import com.google.gwt.event.dom.client.ChangeEvent;
|
||||
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.event.dom.client.KeyUpEvent;
|
||||
import com.google.gwt.event.dom.client.KeyUpHandler;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
@@ -175,12 +177,24 @@ public abstract class DataEntryDialog<T> {
|
||||
oracle.addAll(suggestValuesAsCollection);
|
||||
oracle.setDefaultSuggestionsFromText(suggestValuesAsCollection);
|
||||
final SuggestBox result = new SuggestBox(oracle);
|
||||
result.getValueBox().addValueChangeHandler(new ValueChangeHandler<String>() {
|
||||
@Override
|
||||
public void onValueChange(ValueChangeEvent<String> event) {
|
||||
validate();
|
||||
}
|
||||
});
|
||||
result.getValueBox().addChangeHandler(new ChangeHandler() {
|
||||
@Override
|
||||
public void onChange(ChangeEvent event) {
|
||||
validate();
|
||||
}
|
||||
});
|
||||
result.getValueBox().addKeyUpHandler(new KeyUpHandler() {
|
||||
@Override
|
||||
public void onKeyUp(KeyUpEvent event) {
|
||||
validate();
|
||||
}
|
||||
});
|
||||
DialogUtils.linkEnterToButton(getOkButton(), result.getValueBox());
|
||||
DialogUtils.linkEscapeToButton(getCancelButton(), result.getValueBox());
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user