myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarinsc...@apache.org
Subject svn commit: r513799 - in /myfaces: core/trunk/api/src/main/java/javax/faces/component/UIInput.java shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
Date Fri, 02 Mar 2007 15:03:41 GMT
Author: mmarinschek
Date: Fri Mar  2 07:03:40 2007
New Revision: 513799

URL: http://svn.apache.org/viewvc?view=rev&rev=513799
Log:
fix for MYFACES-1549 : MyFaces-API issue: coming from the other side - the fix can also be
added in the renderer, this is the fix for getStringValue - the other access methods should
be fixed just like this one.

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java
    myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java?view=diff&rev=513799&r1=513798&r2=513799
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIInput.java Fri Mar  2 07:03:40
2007
@@ -477,7 +477,7 @@
 
     public Object saveState(FacesContext context)
     {
-        Object values[] = new Object[10];
+        Object values[] = new Object[9];
         values[0] = super.saveState(context);
         values[1] = _immediate;
         values[2] = Boolean.valueOf(_localValueSet);

Modified: myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
URL: http://svn.apache.org/viewvc/myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java?view=diff&rev=513799&r1=513798&r2=513799
==============================================================================
--- myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
(original)
+++ myfaces/shared/trunk/core/src/main/java/org/apache/myfaces/shared/renderkit/RendererUtils.java
Fri Mar  2 07:03:40 2007
@@ -204,7 +204,10 @@
             }
 
             if (component instanceof EditableValueHolder) {
-                Object submittedValue = ((EditableValueHolder) component).getSubmittedValue();
+
+                EditableValueHolder holder = (EditableValueHolder) component;
+
+                Object submittedValue = holder.getSubmittedValue();
                 if (submittedValue != null) {
                     if (submittedValue instanceof String) {
                         return (String) submittedValue;
@@ -214,18 +217,24 @@
                             + getPathToComponent(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);
+            if(component instanceof EditableValueHolder) {
+
+                EditableValueHolder holder = (EditableValueHolder) component;
+                
+                if(holder.isLocalValueSet()) {
+                    value = holder.getLocalValue();
+                }
+
+                value = getValue(component);
+            }
+            else {
+
+                value = getValue(component);
             }
 
             Converter converter = ((ValueHolder) component).getConverter();
@@ -260,6 +269,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