// return function;
}
public void encodeTableMenu(FacesContext context, UIExtendedDataTable table)
throws IOException {
AjaxContext ajaxContext = AjaxContext.getCurrentInstance();
Object key = table.getRowKey();
table.setRowKey(null);
TableMenuRenderer menuRenderer = new RichTableMenuRenderer();
menuRenderer.setSortFunction(getSortFunction(context, table));
menuRenderer.setGroupFunction(getGroupFunction(context, table));
menuRenderer
.setChangeColumnVisibilityFunction(getChangeColumnVisibilityFunction(
context, table));
menuRenderer.setPrepareFunction(getPreSendAjaxRequestFunction(context,
table));
for (Iterator<UIColumn> colums = table.getSortedColumns(); colums
.hasNext();) {
UIColumn col = colums.next();
if (col.isRendered()) {
String menuId = menuRenderer.renderMenu(context, table, col);
ajaxContext.addRenderedArea(menuId);
}
}// for
table.setRowKey(key);
}