if (child instanceof UITab) {
UITab tab = (UITab) child;
if (tab.isRendered()) {
UIMenuCommand entry = (UIMenuCommand) CreateComponentUtils.createComponent(
facesContext, UIMenuCommand.COMPONENT_TYPE, RendererTypes.MENU_COMMAND, "entry-" + index);
LabelWithAccessKey label = new LabelWithAccessKey(tab);
entry.setLabel(label.getText());
if (tab.isDisabled()) {
entry.setDisabled(true);
} else {
entry.setOnclick(JQueryUtils.selectId(clientId)
+ ".find('.tobago-tab[tabgroupindex=" + index + "]')"