Author: nbelaevski
Date: 2010-07-01 03:44:12 -0400 (Thu, 01 Jul 2010)
New Revision: 17694
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SelectionRenderer.java
Log:
TODOs for selection renderer commit
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SelectionRenderer.java
===================================================================
---
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SelectionRenderer.java 2010-07-01
03:29:25 UTC (rev 17693)
+++
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SelectionRenderer.java 2010-07-01
07:44:12 UTC (rev 17694)
@@ -45,11 +45,13 @@
private class ClientSelection {
+ //TODO nick - use enum instead of constant
public static final String FLAG_RESET = "x";
public static final String FLAG_ALL = "a";
public static final String FLAG_AFTER_RANGE = "d";
public static final String FLAG_BEFORE_RANGE = "u";
+ //TODO nick - add special class that will express selection range
private int [][] ranges;
private int activeIndex;
private int shiftIndex;
@@ -57,6 +59,7 @@
private int index;
public ClientSelection(String selectionString) {
+ //TODO nick - this code is not readable at all - lacks comments, has lot of
arrays operation
String[] strings = selectionString.split("\\|", -1);
String[] rangeStrings = strings[0].split(";");
if (strings[0].length() > 0) {
@@ -122,6 +125,7 @@
protected void encodeSelectionInput(ResponseWriter writer, FacesContext context,
UIComponent component)
throws IOException {
writer.startElement(HTML.INPUT_ELEM, component);
+ //TODO nick - selection input id should use constants/be a method
writer.writeAttribute(HTML.ID_ATTRIBUTE, component.getClientId(context) +
":si", null);
writer.writeAttribute(HTML.NAME_ATTRIBUTE, component.getClientId(context) +
":si", null);
writer.writeAttribute(HTML.TYPE_ATTR, HTML.INPUT_TYPE_HIDDEN, null);
@@ -172,6 +176,7 @@
Collection<Object> selectedRowKeys = table.getSelectedRowKeys();
if (selectedRowKeys == null) {
selectedRowKeys = new HashSet<Object>();
+ //TODO nick - model updates should not happen on the 2nd phase
updateAttribute(context, component, "selectedRowKeys",
selectedRowKeys);
}
final Collection<Object> rowKeys = selectedRowKeys;
Show replies by date