myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r681186 - in /myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator: core/ProxyMappingPhaseListener.java util/ExtValUtils.java
Date Wed, 30 Jul 2008 20:06:36 GMT
Author: gpetracek
Date: Wed Jul 30 13:06:35 2008
New Revision: 681186

URL: http://svn.apache.org/viewvc?rev=681186&view=rev
Log:
improved proxy mapping mechanism

Modified:
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ProxyMappingPhaseListener.java
    myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ProxyMappingPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ProxyMappingPhaseListener.java?rev=681186&r1=681185&r2=681186&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ProxyMappingPhaseListener.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/core/ProxyMappingPhaseListener.java
Wed Jul 30 13:06:35 2008
@@ -27,7 +27,8 @@
 import javax.faces.event.PhaseListener;
 import javax.faces.context.FacesContext;
 import javax.faces.component.UIComponent;
-import javax.faces.component.EditableValueHolder;
+import javax.faces.component.ValueHolder;
+import javax.faces.convert.Converter;
 
 /**
  * due to a restriction at the state saving process
@@ -89,9 +90,17 @@
      * @param uiComponent reference to the current component
      */
     private void storeComponentConverterMappingForProxies(FacesContext facesContext, UIComponent
uiComponent) {
+        //TODO use the following after the impl. of a better multi-window-mode solution
+        //if(!uiComponent.isRendered()) {
+        //    return;
+        //}
+        
         for(UIComponent child : uiComponent.getChildren()) {
-            if(child instanceof EditableValueHolder) {
-                ExtValUtils.getOrInitProxyMapping().put(child.getClientId(facesContext),
((EditableValueHolder)child).getConverter());
+            if(child instanceof ValueHolder) {
+                Converter converter = ((ValueHolder)child).getConverter();
+                if(converter != null && converter.getClass().getName().contains("$$"))
{
+                    ExtValUtils.getOrInitProxyMapping().put(child.getClientId(facesContext),
child);
+                }
             }
             storeComponentConverterMappingForProxies(facesContext, child);
         }

Modified: myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java?rev=681186&r1=681185&r2=681186&view=diff
==============================================================================
--- myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
(original)
+++ myfaces/extensions/validator/trunk/core/src/main/java/org/apache/myfaces/extensions/validator/util/ExtValUtils.java
Wed Jul 30 13:06:35 2008
@@ -142,13 +142,8 @@
         Map<String, Object> map;
         if(!storage.containsKey(viewId)) {
             map = new HashMap<String, Object>();
-        } else {
-            //TODO cleanup session
-            map = storage.get(viewId);
-            //don't use the line below - a popup/new window would delete the mapping
-            //storage = new HashMap<String, Map<String, Object>>();
+            storage.put(viewId, map);
         }
-        storage.put(viewId, map);
 
         sessionMap.put(PROXY_MAPPING_KEY, storage);
     }



Mime
View raw message