int i = 0;
for (UIComponent child : (List<UIComponent>) data.getChildren()) {
if (child instanceof UIColumnEvent) {
UIColumnEvent columnEvent = (UIColumnEvent) child;
if (columnEvent.isRendered()) {
UIComponent selectionChild = (UIComponent) child.getChildren().get(0);
if (selectionChild != null && selectionChild instanceof UICommand && selectionChild.isRendered()) {
UICommand action = (UICommand) selectionChild;
if ("click".equals(columnEvent.getEvent())) {
clickAction = action;
}
if ("dblclick".equals(columnEvent.getEvent())) {
dblClickAction = action;
}
}
}
} else if (child instanceof UIColumnSelector) {
columnSelectorIndex = i;
}
i++;
}
renderSheet(facesContext, data, (clickAction != null || dblClickAction != null));
writer.endElement(HtmlConstants.DIV);
ResourceManager resourceManager = ResourceManagerFactory.getResourceManager(facesContext);
UIViewRoot viewRoot = facesContext.getViewRoot();
String contextPath = facesContext.getExternalContext().getRequestContextPath();
String unchecked = contextPath + resourceManager.getImage(viewRoot, "image/sheetUnchecked.gif");
String checked = contextPath + resourceManager.getImage(viewRoot, "image/sheetChecked.gif");
boolean ajaxEnabled = TobagoConfig.getInstance(facesContext).isAjaxEnabled();
final String[] styles = new String[]{"style/tobago-sheet.css"};
final String[] scripts = new String[]{"script/tobago-sheet.js"};
Integer frequency = null;
UIComponent facetReload = data.getFacet(TobagoConstants.FACET_RELOAD);
if (facetReload != null && facetReload instanceof UIReload && facetReload.isRendered()) {
UIReload update = (UIReload) facetReload;
frequency = update.getFrequency();
}
final String[] cmds = {
"new Tobago.Sheet(\"" + sheetId + "\", " + ajaxEnabled