myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manol...@apache.org
Subject svn commit: r592018 - /myfaces/shared/branches/3_0_1/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
Date Mon, 05 Nov 2007 14:38:18 GMT
Author: manolito
Date: Mon Nov  5 06:38:17 2007
New Revision: 592018

URL: http://svn.apache.org/viewvc?rev=592018&view=rev
Log:
MYFACES-1758

Modified:
    myfaces/shared/branches/3_0_1/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java

Modified: myfaces/shared/branches/3_0_1/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/branches/3_0_1/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java?rev=592018&r1=592017&r2=592018&view=diff
==============================================================================
--- myfaces/shared/branches/3_0_1/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
(original)
+++ myfaces/shared/branches/3_0_1/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
Mon Nov  5 06:38:17 2007
@@ -263,7 +263,21 @@
                 }
             }
 
-            Object value = ((ValueHolder)component).getValue();
+            Object value;
+
+            if(component instanceof EditableValueHolder) {
+
+                EditableValueHolder holder = (EditableValueHolder) component;
+                
+                if(holder.isLocalValueSet()) {
+                    value = holder.getLocalValue();
+                } else {
+                    value = getValue(component);
+                }
+            }
+            else {
+                value = getValue(component);
+            }
 
             Converter converter = ((ValueHolder)component).getConverter();
             if (converter == null  && value != null)
@@ -304,6 +318,20 @@
 
             throw ex;
         }
+    }
+
+    private static Object getValue(UIComponent component) {
+        Object value;
+        try
+        {
+            value = ((ValueHolder) component).getValue();
+        }
+        catch(Exception ex)
+        {
+            throw new FacesException("Could not retrieve value of component with path : "+
+                    getPathToComponent(component),ex);
+        }
+        return value;
     }
 
     /**



Mime
View raw message