if (HANDLER.KEY_.STRING_VALUE_CHANGE_HANDLER.equals(handler)) {
uiObject.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(final ValueChangeEvent<String> event) {
final PTInstruction eventInstruction = new PTInstruction();
eventInstruction.put(TYPE.KEY, TYPE.KEY_.EVENT);
eventInstruction.setObjectID(addHandler.getObjectID());
eventInstruction.put(HANDLER.KEY, HANDLER.KEY_.STRING_VALUE_CHANGE_HANDLER);
eventInstruction.put(PROPERTY.TEXT, event.getValue());
uiService.sendDataToServer(eventInstruction);
}
});
} else if (HANDLER.KEY_.STRING_SELECTION_HANDLER.equals(handler)) {
uiObject.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {
@Override
public void onSelection(final SelectionEvent<Suggestion> event) {
final PTInstruction eventInstruction = new PTInstruction();
eventInstruction.setObjectID(addHandler.getObjectID());
eventInstruction.put(TYPE.KEY, TYPE.KEY_.EVENT);
eventInstruction.put(HANDLER.KEY, HANDLER.KEY_.STRING_SELECTION_HANDLER);
eventInstruction.put(PROPERTY.DISPLAY_STRING, event.getSelectedItem().getDisplayString());
eventInstruction.put(PROPERTY.REPLACEMENT_STRING, event.getSelectedItem().getReplacementString());
uiService.sendDataToServer(eventInstruction);
}
});
} else {
super.addHandler(addHandler, uiService);