[richfaces-svn-commits] JBoss Rich Faces SVN: r5248 - in trunk/sandbox/ui/combobox/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Wed Jan 9 15:43:59 EST 2008


Author: vmolotkov
Date: 2008-01-09 15:43:59 -0500 (Wed, 09 Jan 2008)
New Revision: 5248

Modified:
   trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
   trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
component is corrected

Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-09 20:28:03 UTC (rev 5247)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-09 20:43:59 UTC (rev 5248)
@@ -71,6 +71,7 @@
 	            <name>listWidth</name>
 	            <classname>java.lang.String</classname>
 	            <description></description>
+	            <defaultvalue><![CDATA["150"]]></defaultvalue>
 	        </property>
 	        <property>
 	            <name>listHeight</name>

Modified: trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-01-09 20:28:03 UTC (rev 5247)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-01-09 20:43:59 UTC (rev 5248)
@@ -3,7 +3,7 @@
 
 Richfaces.ComboBox.prototype = {
 	
-	initialize: function(combobox, listId, parentListId, fieldId, buttonId, classes, listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue, selectFirstOnUpdate, onlistcall, onselected, defaultMessage) {
+	initialize: function(combobox, listId, parentListId, fieldId, buttonId, classes, listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue, selectFirstOnUpdate, onlistcall, onselected, onchange, defaultMessage) {
 		this.directInputSuggestions = directInputSuggestions;
 		this.filterNewValue = filterNewValue;
 		
@@ -17,6 +17,7 @@
 		this.defaultMessage = defaultMessage;
 		
 		this.onselected = onselected;
+		this.onchange = onchange;
 		
 		this.isSelection = true;
 		
@@ -41,6 +42,10 @@
 			this.combobox.observe("rich:onitemselected", this.onselected);
 		}
 		
+		if (this.onchange) {
+			this.combobox.observe("rich:onchange", this.onchange);
+		}
+		
 		if (this.defaultMessage) {
 			this.applyDefaultText();
 		}
@@ -94,8 +99,17 @@
 		}
 		var value = this.comboList.selectedItem.innerHTML;
 		if (toSetOnly) {
+			var oV = this.field.value; 
+			if (oV == value) {
+				if (Prototype.Browser.Gecko) {
+					this.field.value = "";
+				}
+			}
 			this.field.value = value;
 			this.combobox.fire("rich:onitemselected", {});
+			if (oV != value) {
+				this.combobox.fire("rich:onchange", {});
+			}
 		} else {
 			if (this.directInputSuggestions) {
 				var startInd = this.field.value.length; 




More information about the richfaces-svn-commits mailing list