[richfaces-svn-commits] JBoss Rich Faces SVN: r5243 - 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 14:47:29 EST 2008


Author: vmolotkov
Date: 2008-01-09 14:47:29 -0500 (Wed, 09 Jan 2008)
New Revision: 5243

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:
selectFirstOnUpdate attribute was added

Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-09 19:36:30 UTC (rev 5242)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-09 19:47:29 UTC (rev 5243)
@@ -56,6 +56,12 @@
 	            <defaultvalue>true</defaultvalue>
 	        </property>
 	        <property>
+	            <name>selectFirstOnUpdate</name>
+	            <classname>java.lang.Boolean</classname>
+	            <description></description>
+	            <defaultvalue>true</defaultvalue>
+	        </property>
+	        <property>
 	            <name>defaultMessage</name>
 	            <classname>java.lang.String</classname>
 	            <description></description>

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 19:36:30 UTC (rev 5242)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-01-09 19:47:29 UTC (rev 5243)
@@ -3,7 +3,7 @@
 
 Richfaces.ComboBox.prototype = {
 	
-	initialize: function(combobox, listId, parentListId, fieldId, buttonId, classes, listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue, onlistcall, onselected, defaultMessage) {
+	initialize: function(combobox, listId, parentListId, fieldId, buttonId, classes, listWidth, listHeight, itemsText, directInputSuggestions, filterNewValue, selectFirstOnUpdate, onlistcall, onselected, defaultMessage) {
 		this.directInputSuggestions = directInputSuggestions;
 		this.filterNewValue = filterNewValue;
 		
@@ -12,7 +12,7 @@
 		this.button = $(buttonId);
 		var fieldDem = Richfaces.ComboBoxList.getElemXY(this.field);
 		fieldDem.height = this.field.offsetHeight;
-		this.comboList = new Richfaces.ComboBoxList(listId, parentListId, classes, listWidth, listHeight, itemsText, onlistcall, fieldDem);
+		this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate, classes, listWidth, listHeight, itemsText, onlistcall, fieldDem);
 		
 		this.defaultMessage = defaultMessage;
 		
@@ -184,7 +184,7 @@
 Richfaces.ComboBoxList = Class.create();
 Richfaces.ComboBoxList.prototype = {
 	
-	initialize: function(listId, parentListId, classes, width, height, itemsText, onlistcall, fieldXY) {
+	initialize: function(listId, parentListId, selectFirstOnUpdate, classes, width, height, itemsText, onlistcall, fieldXY) {
 		this.list = $(listId);
 		this.listParent = $(parentListId);
 		
@@ -196,6 +196,7 @@
 			this.listParent.observe("rich:onlistcall", this.onlistcall);
 		}
 		
+		this.selectFirstOnUpdate = selectFirstOnUpdate;
 		this.classes = classes;
 		this.isList = false;
 		
@@ -239,8 +240,10 @@
 		this.setPosition(this.fieldDimensions.top, this.fieldDimensions.left, this.fieldDimensions.height);
 		
 		var curItems = this.getItems();
-		if (curItems.length != 0) {
-			this.selectItem(curItems[0]);
+		if (this.selectFirstOnUpdate) {
+			if (curItems.length != 0) {
+				this.selectItem(curItems[0]);
+			}
 		}
 		this.listParent.show();
 		this.listParent.fire("rich:onlistcall", {});




More information about the richfaces-svn-commits mailing list