@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
validateParameters(context, component);
AllRowsSelectorComponent allRowsSelector = (AllRowsSelectorComponent) component;
UIData data = getTargetUIData(allRowsSelector);
RowSelectorComponent rowSelector = getRowSelector(data);
if (rowSelector.getMode() != RowSelectorComponent.Mode.multi) {
log.error("An allRowsSelector component was specified for dataTable component " + data
+ ", which has a rowSelector with mode 'single', "
+ "but allRowsSelector components can only be used with rowSelectors with mode 'multi'. "
+ "The allRowSelector will not be rendered.");
allRowsSelector.setRendered(false);
return;
}
// TODO: Do not render if the data model's row count is 0.