I need to add a handler that fires when a selection is CLICKED which will then validate the value. Current functionality is validating (through textInput on blur) right before the entire value is recorded from the suggestbox, thus not passing validation (when it should).
Here is what i tried right below where i implement the suggestbox in the TextInput page:
public void onModuleLoad() {
SuggestBox box = new SuggestBox(createListOracle(),myTextBox());
box.addSelectionHandler(new SelectionHandler<Suggestion>() {
@Override
public void onSelection(SelectionEvent<Suggestion> event) {
Validate();
}
});
another solution could be to insert the courser on focus when suggestbox is selected from, that would accomplish the same thing for me.
The problem is the handler is never firing. The break-point is never reached.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…