@Override
public void onEvent(final IEvent<?> event) {
super.onEvent(event);
if (event.getPayload() instanceof RoleSummaryUpdateEvent) {
final RoleSummaryUpdateEvent update = (RoleSummaryUpdateEvent) event.getPayload();
fragment = new Fragment("rolePanel", (update.getSelectedNodeId() == 0
? "rootPanel" : "roleViewPanel"), this);
if (update.getSelectedNodeId() == 0) {
actionLink = new TreeActionLinkPanel("actionLink", update.getSelectedNodeId(),
new CompoundPropertyModel(this.selectedNode), window, pageRef);
actionLink.setOutputMarkupId(true);
fragment.addOrReplace(actionLink);
} else {
this.selectedNode = restClient.readRole(update.getSelectedNodeId());
roleTabPanel = new RoleTabPanel("nodeViewPanel", this.selectedNode, window, pageRef);
roleTabPanel.setOutputMarkupId(true);
fragment.addOrReplace(roleTabPanel);
}
replace(fragment);
update.getTarget().add(this);
}
}