myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bom...@apache.org
Subject svn commit: r1178908 - /myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
Date Tue, 04 Oct 2011 19:05:49 GMT
Author: bommel
Date: Tue Oct  4 19:05:49 2011
New Revision: 1178908

URL: http://svn.apache.org/viewvc?rev=1178908&view=rev
Log:
(TOBAGO-1035)
Unified access to partialComponentsId in AjaxUtils for 1.0.x and 1.5.x

Modified:
    myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java

Modified: myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java?rev=1178908&r1=1178907&r2=1178908&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
(original)
+++ myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
Tue Oct  4 19:05:49 2011
@@ -36,9 +36,12 @@ import javax.faces.render.Renderer;
 import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Set;
 import java.util.StringTokenizer;
 
 public class AjaxUtils {
@@ -137,6 +140,21 @@ public class AjaxUtils {
     }
   }
 
+  public static Set<String> getRequestPartialIds(FacesContext facesContext) {
+    Map parameterMap = facesContext.getExternalContext().getRequestParameterMap();
+    String ajaxComponentIds = (String) parameterMap.get(AjaxPhaseListener.AJAX_COMPONENT_ID);
+    if (ajaxComponentIds != null) {
+      StringTokenizer tokenizer = new StringTokenizer(ajaxComponentIds, ",");
+      Set<String> ajaxComponents = new HashSet<String>(tokenizer.countTokens());
+      while (tokenizer.hasMoreTokens()) {
+        String ajaxId = tokenizer.nextToken();
+        ajaxComponents.add(ajaxId);
+      }
+      return ajaxComponents;
+    }
+    return Collections.EMPTY_SET;
+  }
+
   public static Map<String, UIComponent> parseAndStoreComponents(FacesContext facesContext)
{
     Map parameterMap = facesContext.getExternalContext().getRequestParameterMap();
     String ajaxComponentIds = (String) parameterMap.get(AjaxPhaseListener.AJAX_COMPONENT_ID);



Mime
View raw message