myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r992175 - /myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java
Date Fri, 03 Sep 2010 02:08:48 GMT
Author: lu4242
Date: Fri Sep  3 02:08:48 2010
New Revision: 992175

URL: http://svn.apache.org/viewvc?rev=992175&view=rev
Log:
use ValueExpression instead ValueBinding

Modified:
    myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java

Modified: myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java?rev=992175&r1=992174&r2=992175&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java
(original)
+++ myfaces/tomahawk/trunk/core20/src/main/java/org/apache/myfaces/component/html/ext/AbstractHtmlDataTable.java
Fri Sep  3 02:08:48 2010
@@ -35,14 +35,12 @@ import javax.faces.component.ContextCall
 import javax.faces.component.EditableValueHolder;
 import javax.faces.component.UIColumn;
 import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
 import javax.faces.component.UINamingContainer;
 import javax.faces.component.UIPanel;
 import javax.faces.component.visit.VisitCallback;
 import javax.faces.component.visit.VisitContext;
 import javax.faces.component.visit.VisitResult;
 import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
 import javax.faces.model.DataModel;
 
 import org.apache.commons.logging.Log;
@@ -1035,26 +1033,26 @@ public abstract class AbstractHtmlDataTa
 
     private void updateModelFromPreservedDataModel(FacesContext context)
     {
-        ValueBinding vb = getValueBinding("value");
-        if (vb != null && !vb.isReadOnly(context))
+        ValueExpression vb = getValueExpression("value");
+        if (vb != null && !vb.isReadOnly(context.getELContext()))
         {
             _SerializableDataModel dm = (_SerializableDataModel) getDataModel();
             Class type = (getValueType() == null) ? 
-                    vb.getType(context) : 
+                    vb.getType(context.getELContext()) : 
                         ClassUtils.simpleClassForName(getValueType());
             Class dmType = dm.getClass();
             if (DataModel.class.isAssignableFrom(type))
             {
-                vb.setValue(context, dm);
+                vb.setValue(context.getELContext(), dm);
             }
             else if (List.class.isAssignableFrom(type) || _SerializableListDataModel.class.isAssignableFrom(dmType))
             {
-                vb.setValue(context, dm.getWrappedData());
+                vb.setValue(context.getELContext(), dm.getWrappedData());
             }
             else if (OBJECT_ARRAY_CLASS.isAssignableFrom(type))
             {
                 List lst = (List) dm.getWrappedData();
-                vb.setValue(context, lst.toArray(new Object[lst.size()]));
+                vb.setValue(context.getELContext(), lst.toArray(new Object[lst.size()]));
             }
             else if (ResultSet.class.isAssignableFrom(type))
             {
@@ -1067,11 +1065,11 @@ public abstract class AbstractHtmlDataTa
                 List lst = (List) dm.getWrappedData();
                 if (lst!= null && lst.size() > 0)
                 {
-                    vb.setValue(context, lst.get(0));
+                    vb.setValue(context.getELContext(), lst.get(0));
                 }
                 else
                 {
-                    vb.setValue(context, null);
+                    vb.setValue(context.getELContext(), null);
                 }
             }
         }
@@ -1274,12 +1272,12 @@ public abstract class AbstractHtmlDataTa
             return null;
         }
 
-        for (Iterator iter = component.getChildren().iterator(); iter.hasNext();)
+        for (Iterator<UIComponent> iter = component.getChildren().iterator(); iter.hasNext();)
         {
             UIComponent aChild = (UIComponent) iter.next();
             if (aChild.isRendered())
             {
-                ValueBinding vb = aChild.getValueBinding("value");
+                ValueExpression vb = aChild.getValueExpression("value");
                 if (vb != null)
                 {
                     String expressionString = vb.getExpressionString();



Mime
View raw message