// update objects ....
eventCategoryTO.getEvents().clear();
final ChangeCategoryEvent change = (ChangeCategoryEvent) event.getPayload();
final Panel changedPanel = change.getChangedPanel();
if ("type".equals(changedPanel.getId())) {
eventCategoryTO.setType(type.getModelObject());
eventCategoryTO.setCategory(null);
eventCategoryTO.setSubcategory(null);
if (type.getModelObject() == EventCategoryType.CUSTOM) {
category.setChoices(Collections.<String>emptyList());
subcategory.setChoices(Collections.<String>emptyList());
category.setEnabled(false);
subcategory.setEnabled(false);
custom.setVisible(true);
custom.setEnabled(true);
actionPanel.setVisible(true);
actionPanel.setEnabled(true);
} else {
category.setChoices(filter(eventCategoryTOs, type.getModelObject()));
subcategory.setChoices(Collections.<String>emptyList());
category.setEnabled(true);
subcategory.setEnabled(true);
custom.setVisible(false);
custom.setEnabled(false);
actionPanel.setVisible(false);
actionPanel.setEnabled(false);
}
change.getTarget().add(categoryContainer);
} else if ("category".equals(changedPanel.getId())) {
subcategory.setChoices(filter(eventCategoryTOs, type.getModelObject(), category.getModelObject()));
eventCategoryTO.setCategory(category.getModelObject());
eventCategoryTO.setSubcategory(null);
change.getTarget().add(categoryContainer);
} else {