[richfaces-svn-commits] JBoss Rich Faces SVN: r5344 - in trunk/sandbox/ui/combobox/src/main: java/org/richfaces/component and 2 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Jan 14 07:01:18 EST 2008


Author: abelevich
Date: 2008-01-14 07:01:18 -0500 (Mon, 14 Jan 2008)
New Revision: 5344

Modified:
   trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
   trunk/sandbox/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java
   trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
   trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
defaultLabel correct processing

Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-14 12:00:18 UTC (rev 5343)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-14 12:01:18 UTC (rev 5344)
@@ -57,12 +57,6 @@
 	            <defaultvalue>true</defaultvalue>
 	        </property>
 	        <property>
-	            <name>defaultMessage</name>
-	            <classname>java.lang.String</classname>
-	            <description></description>
-	        </property>
-	        
-	        <property>
 	            <name>showDelay</name>
 	            <classname>java.lang.Integer</classname>
 	            <description></description>

Modified: trunk/sandbox/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java
===================================================================
--- trunk/sandbox/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java	2008-01-14 12:00:18 UTC (rev 5343)
+++ trunk/sandbox/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java	2008-01-14 12:01:18 UTC (rev 5344)
@@ -16,5 +16,9 @@
 	
 	public abstract Object getSuggestionValues();
 	public abstract void  setSuggestionValues(Object value);	
+	public abstract String getDefaultLabel();
+	public abstract void setDefaultLabel(String label);
+		
 	
+	
 }
\ No newline at end of file

Modified: trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java	2008-01-14 12:00:18 UTC (rev 5343)
+++ trunk/sandbox/ui/combobox/src/main/java/org/richfaces/renderkit/ComboBoxBaseRenderer.java	2008-01-14 12:01:18 UTC (rev 5344)
@@ -74,7 +74,9 @@
 		Map request = context.getExternalContext().getRequestParameterMap();
 		if (request.containsKey(clientId)) {
 			String newValue = (String)request.get(clientId);
-			comboBox.setSubmittedValue(newValue);
+			if (!newValue.equals(comboBox.getDefaultLabel())) { 
+				comboBox.setSubmittedValue(newValue);
+			}	
 		}
 	}
 	

Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-14 12:00:18 UTC (rev 5343)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-14 12:01:18 UTC (rev 5344)
@@ -61,6 +61,9 @@
 	        
 	    	Object value = component.getAttributes().get("value");
 	    	value = getConvertedStringValue(context, component,value);
+	    	if (value == null || value.equals("")) {
+	    		value = defaultLabel;
+	    	}
 	    	variables.setVariable("value", value);
 
 	    	Object inputStyle = component.getAttributes().get("inputStyle");
@@ -183,7 +186,8 @@
          }
 		]]>
 	</jsp:scriptlet>
-	<div id="#{clientId}" class="rich-combobox-font rich-combobox-shell #{styleClass}" style="width:#{listWidth}; #{style}">
+	<div id="#{clientId}" class="rich-combobox-font rich-combobox-shell #{styleClass}" style="width:#{listWidth}; #{style}"
+		 x:passThruWithExclusions="value,name,type,id,styleClass,class,style,size,autocomplete,disabled,onchange">
 		<div class="rich-combobox-font rich-combobox-shell" style="width:#{width}">
 			<input id="comboboxField#{clientId}" 
 				   name="comboboxField#{clientId}" 
@@ -192,9 +196,10 @@
 				   value="#{value}" 
 				   size="#{inputSize}" 
 				   autocomplete="off" 
-				   onchange='#{component.attributes["onchange"]}'
+				   onchange="#{component.attributes['onchange']}"
+				   onselect="#{component.attributes['onselect']}"
+				   onblur="#{component.attributes['onblur']}"
 				   style="width:#{width}; #{inputStyle}"
-				   x:passThruWithExclusions="value,name,type,id,styleClass,class,style,size,autocomplete,disabled,onchange"
 				   />
 			<input id="comboBoxButtonBG#{clientId}" readonly="true" type="text" value="" class="rich-combobox-font rich-combobox-button-background rich-combobox-button"/>
 			<input id="comboboxButton#{clientId}" readonly="true" disabled="#{disabled}" type="text" value="" style="#{buttonStyle}" 




More information about the richfaces-svn-commits mailing list