[richfaces-svn-commits] JBoss Rich Faces SVN: r13352 - in trunk/framework/impl/src/main/java/org: richfaces/component and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Apr 1 18:43:30 EDT 2009


Author: nbelaevski
Date: 2009-04-01 18:43:30 -0400 (Wed, 01 Apr 2009)
New Revision: 13352

Modified:
   trunk/framework/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java
   trunk/framework/impl/src/main/java/org/richfaces/component/FileUploadConstants.java
   trunk/framework/impl/src/main/java/org/richfaces/context/RequestContext.java
Log:
Refactoring:
- FileUploadConstants
- RequestContext
- SelectUtils

Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java	2009-04-01 21:49:08 UTC (rev 13351)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/SelectUtils.java	2009-04-01 22:43:30 UTC (rev 13352)
@@ -261,9 +261,9 @@
 	public static Converter getConverterForProperty(FacesContext facesContext, UIOutput component, String property){
 		Converter converter = component.getConverter();
 		if(converter == null){
-			ValueBinding valueBinding = component.getValueBinding(property);
-			if(valueBinding != null){
-				Class valueType = valueBinding.getType(facesContext);
+			ValueExpression ve = component.getValueExpression(property);
+			if(ve != null){
+				Class<?> valueType = ve.getType(facesContext.getELContext());
 				if(valueType == null || String.class.equals(valueType) || Object.class.equals(valueType)){
 					//No converter needed
 				} else {

Modified: trunk/framework/impl/src/main/java/org/richfaces/component/FileUploadConstants.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/component/FileUploadConstants.java	2009-04-01 21:49:08 UTC (rev 13351)
+++ trunk/framework/impl/src/main/java/org/richfaces/component/FileUploadConstants.java	2009-04-01 22:43:30 UTC (rev 13352)
@@ -53,6 +53,8 @@
 
 	public static final String FILE_UPLOAD_ACTION_STOP = "richfaces_file_upload_action_stop";
 	
+	public static final String FILE_UPLOAD_ACTION_PROGRESS = "progress";
+
 	private FileUploadConstants() {
 		//private constructor
 	}

Modified: trunk/framework/impl/src/main/java/org/richfaces/context/RequestContext.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/context/RequestContext.java	2009-04-01 21:49:08 UTC (rev 13351)
+++ trunk/framework/impl/src/main/java/org/richfaces/context/RequestContext.java	2009-04-01 22:43:30 UTC (rev 13352)
@@ -71,11 +71,17 @@
 	}
 	
 	public void setAttribute(String name, Object value) {
-		if (attributesMap == null) {
-			attributesMap = new HashMap<String, Object>();
+		if (value != null) {
+			if (attributesMap == null) {
+				attributesMap = new HashMap<String, Object>();
+			}
+
+			attributesMap.put(name, value);
+		} else {
+			if (attributesMap != null) {
+				attributesMap.remove(name);
+			}
 		}
-		
-		attributesMap.put(name, value);
 	}
 	
 }




More information about the richfaces-svn-commits mailing list