if (HANDLER.KEY_.SELECTION_HANDLER.equals(handler)) {
uiObject.addSelectionHandler(new SelectionHandler<Integer>() {
@Override
public void onSelection(final SelectionEvent<Integer> event) {
final PTInstruction eventInstruction = new PTInstruction();
eventInstruction.setObjectID(addHandler.getObjectID());
eventInstruction.put(TYPE.KEY, TYPE.KEY_.EVENT);
eventInstruction.put(HANDLER.KEY, HANDLER.KEY_.SELECTION_HANDLER);
eventInstruction.put(PROPERTY.INDEX, event.getSelectedItem());
uiService.sendDataToServer(eventInstruction);
}
});
} else if (HANDLER.KEY_.BEFORE_SELECTION_HANDLER.equals(handler)) {
uiObject.addBeforeSelectionHandler(new BeforeSelectionHandler<Integer>() {
@Override
public void onBeforeSelection(final BeforeSelectionEvent<Integer> event) {
final PTInstruction eventInstruction = new PTInstruction();
eventInstruction.setObjectID(addHandler.getObjectID());
eventInstruction.put(TYPE.KEY, TYPE.KEY_.EVENT);
eventInstruction.put(HANDLER.KEY, HANDLER.KEY_.BEFORE_SELECTION_HANDLER);
eventInstruction.put(PROPERTY.INDEX, event.getItem());
uiService.sendDataToServer(eventInstruction);
}
});
} else {
super.addHandler(addHandler, uiService);