String name = ((AbstractTogglePanelTitledItem) child).getName();
// active item is determined by the name
if (name.equals(activeItem)) {
// child needs to be UICommand to broadcast event
UICommand childCommand = (UICommand) child;
ActionEvent actionEvent = new ActionEvent(childCommand);
// if the immediate attribute is set than event should be broadcasted on the second phase APPLY_REQUEST_VALUES
// in other case it should be queued to be executed on
if(isImmediate()){
childCommand.broadcast(actionEvent);
} else {
actionEvent.queue();
}
break;
}
}
}