Author: konstantin.mishin
Date: 2010-07-06 12:45:59 -0400 (Tue, 06 Jul 2010)
New Revision: 17743
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SelectionRenderer.java
Log:
RF-8101
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
---
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-07-06
15:49:47 UTC (rev 17742)
+++
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2010-07-06
16:45:59 UTC (rev 17743)
@@ -78,7 +78,7 @@
}
protected enum PropertyKeys {
- filterVar, sortPriority, sortMode, first, rows, noDataLabel, selectedRowKeys
+ filterVar, sortPriority, sortMode, first, rows, noDataLabel, selection
}
public Iterator<UIComponent> columns() {
@@ -215,12 +215,12 @@
}
@SuppressWarnings("unchecked")
- public Collection<Object> getSelectedRowKeys() {
- return (Collection<Object>)
getStateHelper().eval(PropertyKeys.selectedRowKeys);
+ public Collection<Object> getSelection() {
+ return (Collection<Object>) getStateHelper().eval(PropertyKeys.selection);
}
- public void setSelectedRowKeys(Collection<Object> selectedRowKeys) {
- getStateHelper().put(PropertyKeys.selectedRowKeys, selectedRowKeys);
+ public void setSelection(Collection<Object> selection) {
+ getStateHelper().put(PropertyKeys.selection, selection);
}
public Collection<?> getSortPriority() {
Modified:
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
---
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-07-06
15:49:47 UTC (rev 17742)
+++
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2010-07-06
16:45:59 UTC (rev 17743)
@@ -702,8 +702,8 @@
UIDataTableBase table = state.getRow();
writer.startElement(HTML.TR_ELEMENT, table);
StringBuilder builder = new StringBuilder();
- Collection<Object> selectedRowKeys = table.getSelectedRowKeys();
- if (selectedRowKeys != null &&
selectedRowKeys.contains(table.getRowKey())) {
+ Collection<Object> selection = table.getSelection();
+ if (selection != null && selection.contains(table.getRowKey())) {
builder.append("rf-edt-r-s");
}
if
(table.getRowKey().equals(table.getAttributes().get("activeRowKey"))) {
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-06
15:49:47 UTC (rev 17742)
+++
root/ui/iteration/trunk/tables/ui/src/main/java/org/richfaces/renderkit/SelectionRenderer.java 2010-07-06
16:45:59 UTC (rev 17743)
@@ -172,16 +172,16 @@
final ClientSelection clientSelection = new
ClientSelection(selectionString);
final Map<String, Object> attributes = component.getAttributes();
UIDataTableBase table = (UIDataTableBase) component;
- Collection<Object> selectedRowKeys = table.getSelectedRowKeys();
- if (selectedRowKeys == null) {
- selectedRowKeys = new HashSet<Object>();
+ Collection<Object> selection = table.getSelection();
+ if (selection == null) {
+ selection = new HashSet<Object>();
//TODO nick - model updates should not happen on the 2nd phase
- updateAttribute(context, component, "selectedRowKeys",
selectedRowKeys);
+ updateAttribute(context, component, "selection", selection);
}
- final Collection<Object> rowKeys = selectedRowKeys;
+ final Collection<Object> rowKeys = selection;
String selectionFlag = clientSelection.getSelectionFlag();
if (selectionFlag != null) {
- selectedRowKeys.clear();
+ selection.clear();
if (!ClientSelection.FLAG_RESET.equals(selectionFlag)) {
encodeSelectionOutsideCurrentRange(context, table, selectionFlag);
}
@@ -236,7 +236,7 @@
table.setRowKey(context, key);
table.restoreOrigValue(context);
if (newRange != null) {
- final Collection<Object> rowKeys = table.getSelectedRowKeys();
+ final Collection<Object> rowKeys = table.getSelection();
table.walk(context, new DataVisitor() {
public DataVisitResult process(FacesContext context, Object rowKey,
Object argument) {
rowKeys.add(rowKey);
Show replies by date