Author: mmarinschek
Date: Wed May 4 09:47:14 2005
New Revision: 168143
URL: http://svn.apache.org/viewcvs?rev=168143&view=rev
Log:
patch of Mathias Werlitz
Modified:
myfaces/trunk/src/components/org/apache/myfaces/custom/datalist/HtmlDataList.java
Modified:
myfaces/trunk/src/components/org/apache/myfaces/custom/datalist/HtmlDataList.java
URL:
http://svn.apache.org/viewcvs/myfaces/trunk/src/components/org/apache/myfaces/custom/datalist/HtmlDataList.java?rev=168143&r1=168142&r2=168143&view=diff
==============================================================================
---
myfaces/trunk/src/components/org/apache/myfaces/custom/datalist/HtmlDataList.java
(original)
+++
myfaces/trunk/src/components/org/apache/myfaces/custom/datalist/HtmlDataList.java
Wed May 4 09:47:14 2005
@@ -29,7 +29,6 @@
public class HtmlDataList
extends UIData
{
-
public void processDecodes(FacesContext context)
{
int first = getFirst();
@@ -50,7 +49,7 @@
{
for (Iterator it = getChildren().iterator(); it.hasNext();)
{
- UIComponent child = (UIComponent)it.next();
+ UIComponent child = (UIComponent) it.next();
if (!child.isRendered())
{
continue;
@@ -63,6 +62,73 @@
setRowIndex(-1);
}
+ public void processUpdates(FacesContext context)
+ {
+ int first = getFirst();
+ int rows = getRows();
+ int last;
+ if (rows == 0)
+ {
+ last = getRowCount();
+ }
+ else
+ {
+ last = first + rows;
+ }
+ for (int rowIndex = first; rowIndex < last; rowIndex++)
+ {
+ setRowIndex(rowIndex);
+ if (isRowAvailable())
+ {
+ for (Iterator it = getChildren().iterator(); it.hasNext();)
+ {
+ UIComponent child = (UIComponent) it.next();
+ if (!child.isRendered())
+ {
+ continue;
+ }
+ child.processUpdates(context);
+ }
+ }
+ }
+
+ setRowIndex(-1);
+ }
+
+
+ public void processValidators(FacesContext context)
+ {
+ int first = getFirst();
+ int rows = getRows();
+ int last;
+ if (rows == 0)
+ {
+ last = getRowCount();
+ }
+ else
+ {
+ last = first + rows;
+ }
+ for (int rowIndex = first; rowIndex < last; rowIndex++)
+ {
+ setRowIndex(rowIndex);
+ if (isRowAvailable())
+ {
+ for (Iterator it = getChildren().iterator(); it.hasNext();)
+ {
+ UIComponent child = (UIComponent) it.next();
+ if (!child.isRendered())
+ {
+ continue;
+ }
+ child.processValidators(context);
+ }
+ }
+ }
+
+ setRowIndex(-1);
+ }
+
public void setRowIndex(int rowIndex)
{
@@ -122,9 +188,12 @@
public String getLayout()
{
- if (_layout != null) return _layout;
+ if (_layout != null)
+ {
+ return _layout;
+ }
ValueBinding vb = getValueBinding("layout");
- return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
}
public void setRowIndexVar(String rowIndexVar)
@@ -134,9 +203,12 @@
public String getRowIndexVar()
{
- if (_rowIndexVar != null) return _rowIndexVar;
+ if (_rowIndexVar != null)
+ {
+ return _rowIndexVar;
+ }
ValueBinding vb = getValueBinding("rowIndexVar");
- return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
}
public void setRowCountVar(String rowCountVar)
@@ -146,9 +218,12 @@
public String getRowCountVar()
{
- if (_rowCountVar != null) return _rowCountVar;
+ if (_rowCountVar != null)
+ {
+ return _rowCountVar;
+ }
ValueBinding vb = getValueBinding("rowCountVar");
- return vb != null ? (String)vb.getValue(getFacesContext()) : null;
+ return vb != null ? (String) vb.getValue(getFacesContext()) : null;
}
@@ -164,11 +239,11 @@
public void restoreState(FacesContext context, Object state)
{
- Object values[] = (Object[])state;
+ Object values[] = (Object[]) state;
super.restoreState(context, values[0]);
- _layout = (String)values[1];
- _rowIndexVar = (String)values[2];
- _rowCountVar = (String)values[3];
+ _layout = (String) values[1];
+ _rowIndexVar = (String) values[2];
+ _rowCountVar = (String) values[3];
}
//------------------ GENERATED CODE END
---------------------------------------
}