You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2011/10/04 21:05:49 UTC
svn commit: r1178908 -
/myfaces/tobago/branches/tobago-1.0.x/core/src/main/java/org/apache/myfaces/tobago/ajax/api/AjaxUtils.java
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);