[richfaces-svn-commits] JBoss Rich Faces SVN: r2517 - trunk/framework/impl/src/main/java/org/ajax4jsf/component.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Aug 27 14:36:15 EDT 2007


Author: nbelaevski
Date: 2007-08-27 14:36:15 -0400 (Mon, 27 Aug 2007)
New Revision: 2517

Modified:
   trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
Log:
http://jira.jboss.com/jira/browse/RF-565 fixed

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java	2007-08-27 18:33:45 UTC (rev 2516)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java	2007-08-27 18:36:15 UTC (rev 2517)
@@ -183,6 +183,11 @@
 	 */
 	private Set _ajaxKeys = null;
 
+	/**
+	 * Internal set of row keys, encoded on ajax response rendering and cleared after response complete
+	 */
+	private Set _ajaxRequestKeys = null;
+
 	private Object _ajaxRowKey = null;
 
 	private Map _ajaxRowKeysMap = new HashMap();
@@ -342,7 +347,27 @@
 		}
 		return keys;
 	}
+	
+	public Set getAllAjaxKeys() {
+		Set ajaxKeys = getAjaxKeys();
+		
+		Set allAjaxKeys = null;
+		if (ajaxKeys != null) {
+			allAjaxKeys = new HashSet();
+			allAjaxKeys.addAll(ajaxKeys);
+		}
+		
+		if (_ajaxRequestKeys != null) {
+			if (allAjaxKeys == null) {
+				allAjaxKeys = new HashSet();
+			}
+			
+			allAjaxKeys.addAll(_ajaxRequestKeys);
+		}
 
+		return allAjaxKeys;
+	}
+
 	/*
 	 * (non-Javadoc)
 	 * 
@@ -388,7 +413,7 @@
 				}
 
 			};
-			Set ajaxKeys = getAjaxKeys();
+			Set ajaxKeys = getAllAjaxKeys();
 			if (null != ajaxKeys) {
 				if(_log.isDebugEnabled()){
 					_log.debug("Component "+getClientId(context)+"  Encode children components for a keys "+ajaxKeys);
@@ -1359,4 +1384,45 @@
 		this._baseClientId = null;
 	}
 
+	/**
+	 * Adds argument key to AJAX internal request keys set
+	 * @param key key to add
+	 */
+	public void addRequestKey(Object key) {
+		if (_ajaxRequestKeys == null) {
+			_ajaxRequestKeys = new HashSet();
+		}
+
+		_ajaxRequestKeys.add(key);
+	}
+
+	/**
+	 * Removes argument key from AJAX internal request keys set
+	 * @param key key to remove
+	 */
+	public void removeRequestKey(Object key) {
+		if (_ajaxRequestKeys != null && key != null) {
+			_ajaxRequestKeys.remove(key);
+		}
+	}
+	
+	/**
+	 * Checks whether AJAX internal request keys set contains argument key
+	 * @param key key to check
+	 * @return <code>true</code> if set contains key, <code>false</code> - otherwise
+	 */
+	public boolean containsRequestKey(Object key) {
+		if (_ajaxRequestKeys != null && key != null) {
+			return _ajaxRequestKeys.contains(key);
+		}
+		
+		return false;
+	}
+	
+	/**
+	 * Clears AJAX internal request keys set
+	 */
+	public void clearRequestKeysSet() {
+		_ajaxRequestKeys = null;
+	}
 }




More information about the richfaces-svn-commits mailing list