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

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Thu Jan 3 11:02:47 EST 2008


Author: vmolotkov
Date: 2008-01-03 11:02:47 -0500 (Thu, 03 Jan 2008)
New Revision: 5126

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
   trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
new component's attributes were added

Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-03 15:34:26 UTC (rev 5125)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-03 16:02:47 UTC (rev 5126)
@@ -32,7 +32,47 @@
        			<name>suggestionValues</name>
        			<classname>java.util.List</classname>
        		</property>
-       	
        	</properties>
+       	<property>
+            <name>filterNewValues</name>
+            <classname>java.lang.Boolean</classname>
+            <description></description>
+            <defaultvalue>true</defaultvalue>
+        </property>
+        <property>
+            <name>directInputSuggestions</name>
+            <classname>java.lang.Boolean</classname>
+            <description></description>
+            <defaultvalue>true</defaultvalue>
+        </property>
+        
+        <property>
+            <name>listWidth</name>
+            <classname>java.lang.String</classname>
+            <description></description>
+        </property>
+        <property>
+            <name>listHeight</name>
+            <classname>java.lang.String</classname>
+            <description></description>
+        </property>
+        <property>
+            <name>inputSize</name>
+            <classname>java.lang.String</classname>
+            <description></description>
+        </property>
+        
+        <property>
+	    	<name>onlistcall</name>
+	    	<classname>java.lang.String</classname>
+	        <description></description>
+	    	<defaultvalue><![CDATA[""]]></defaultvalue>
+	    </property>
+	    <property>
+	    	<name>onselected</name>
+	    	<classname>java.lang.String</classname>
+	        <description></description>
+	    	<defaultvalue><![CDATA[""]]></defaultvalue>
+	    </property>
     </component>
 </components>

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-03 15:34:26 UTC (rev 5125)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-01-03 16:02:47 UTC (rev 5126)
@@ -211,8 +211,8 @@
 	},
 	
 	setSize : function(width, height) {
-		this.listParent.style.width = width + "px";
-		this.listParent.style.height = height + "px";
+		this.listParent.style.width = width;
+		this.listParent.style.height = height;
 	},
 	
 	scrolling : function(event) {

Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-03 15:34:26 UTC (rev 5125)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-03 16:02:47 UTC (rev 5126)
@@ -10,6 +10,8 @@
 	class="org.richfaces.renderkit.html.ComboBoxRenderer"
 	component="org.richfaces.component.UIComboBox"> 
 	
+	<jsp:directive.page import="org.richfaces.component.util.HtmlUtil" />
+	
 	<h:styles>css/combobox.xcss</h:styles>
 	<h:scripts>
 			new org.ajax4jsf.javascript.PrototypeScript(),
@@ -18,9 +20,39 @@
 	</h:scripts>
  
 	<f:clientid var="clientId" />
-
+	
+	<jsp:scriptlet>
+		<![CDATA[
+            Boolean directInputSuggestions = (Boolean) component.getAttributes().get("directInputSuggestions");
+            variables.setVariable("directInputSuggestions", directInputSuggestions);
+            
+            Boolean filterNewValues = (Boolean) component.getAttributes().get("filterNewValues");
+            variables.setVariable("filterNewValues", filterNewValues);
+            
+            String listHeight = (String) component.getAttributes().get("listHeight");
+			if (listHeight != null) {
+				listHeight = HtmlUtil.qualifySize(listHeight);
+			}
+			variables.setVariable("listHeight", listHeight);
+		
+			String listWidth = (String) component.getAttributes().get("listWidth");
+	    	if (listWidth != null) {
+	    		listWidth = HtmlUtil.qualifySize(listWidth);
+	    	}
+	    	variables.setVariable("listWidth", listWidth);
+	    	
+	    	String inputSize = (String) component.getAttributes().get("inputSize");
+	    	if (inputSize != null) {
+	    		inputSize = HtmlUtil.qualifySize(inputSize);
+	    	}
+	    	variables.setVariable("inputSize", inputSize);
+    		
+    		
+		]]>
+    </jsp:scriptlet>
+			                					
 	<div id="#{clientId}" class="rich_cb_width rich_cb_font rich_cb_shell">
-		<input id="comboboxField#{clientId}" class="rich_cb_width rich_cb_font rich_cb_field" type="text" size="20" autocomplete="off">
+		<input id="comboboxField#{clientId}" class="rich_cb_width rich_cb_font rich_cb_field" type="text" size="#{inputSize}" autocomplete="off">
 		</input>
 		<input readonly="" type="text" value="" class="rich_cb_button rich_cb_font rich_cb_button_bg">
 		</input>
@@ -40,8 +72,11 @@
 		var combobox = new Richfaces.ComboBox("#{clientId}", 
 							   "list#{clientId}", 
 							   "comboboxField#{clientId}", 
-							   "comboboxButton#{clientId}", Richfaces.ComboBoxList.CLASSES, 100, 150,
-							   #{this:getItemsTextAsJSArray(context, component)}, false, false, 
+							   "comboboxButton#{clientId}", Richfaces.ComboBoxList.CLASSES, 
+							   "#{listWidth}", "#{listHeight}",
+							   #{this:getItemsTextAsJSArray(context, component)}, 
+							   #{directInputSuggestions}, 
+							   #{filterNewValues}, 
 							   #{this:getAsEventHandler(context, component, "onlistcall")}, 
 							   #{this:getAsEventHandler(context, component, "onselected")});
 	</script>




More information about the richfaces-svn-commits mailing list