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

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Jan 11 13:14:46 EST 2008


Author: vmolotkov
Date: 2008-01-11 13:14:46 -0500 (Fri, 11 Jan 2008)
New Revision: 5315

Modified:
   trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
   trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss
   trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
   trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
component was corrected

Modified: trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml
===================================================================
--- trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-11 18:10:58 UTC (rev 5314)
+++ trunk/sandbox/ui/combobox/src/main/config/component/combobox.xml	2008-01-11 18:14:46 UTC (rev 5315)
@@ -77,7 +77,6 @@
 	            <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/css/combobox.xcss
===================================================================
--- trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss	2008-01-11 18:10:58 UTC (rev 5314)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/css/combobox.xcss	2008-01-11 18:14:46 UTC (rev 5315)
@@ -85,7 +85,7 @@
 
 .rich-combobox-list-scroll { 
 	overflow-y : auto;
-	overflow-x : hidden;
+	overflow-x : auto;
 }
 
 .rich-combobox-list-cord { 
@@ -94,8 +94,9 @@
 }/*DDL is hidden!!!!!*/
 
 .rich-combobox-item {
-	padding : 2px; white-space : nowrap;
-	width: 100%;
+	padding : 2px; 
+	white-space : nowrap;
+	/*width: 100%; */
 	display: block;
 }
 

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-11 18:10:58 UTC (rev 5314)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-01-11 18:14:46 UTC (rev 5315)
@@ -13,6 +13,7 @@
 		this.buttonBG = $(buttonBGId);
 		var fieldDem = Richfaces.ComboBoxList.getElemXY(this.field);
 		fieldDem.height = this.field.offsetHeight;
+		listWidth = (!listWidth) ? this.getCurrentWidth() : listWidth;
 		this.comboList = new Richfaces.ComboBoxList(listId, parentListId, selectFirstOnUpdate, classes.COMBO_LIST, listWidth, listHeight, itemsText, onlistcall, fieldDem);
 		
 		this.defaultMessage = defaultMessage;
@@ -53,6 +54,10 @@
 		}
 	},
 	
+	getCurrentWidth : function() {
+		return this.combobox.firstChild.offsetWidth;	
+	},
+	
 	clickHandler : function(event) {
 		if (this.comboList.visible()) {
 			this.comboList.hide();
@@ -347,16 +352,25 @@
 		//this.listParent.style.height = height;
 		this.list.style.height = height;
 		
-		if (this.width) {
-			var width = this.width;
-			/*if (Prototype.Browser.Gecko) {
-				width = parseInt(this.width) - Richfaces.ComboBoxList.LAYOUT_BORDER_H - Richfaces.ComboBoxList.LAYOUT_PADDING_H;
-			}*/
-			this.listParent.style.width = width;
-			this.list.style.width = width;
-		}
+		//if (this.width) {
+		this.setWidth(this.width);
+		//}
 	},
 	
+	setWidth : function(width) {
+		var iframe = this.listParent.childNodes[0];
+		var positionElem = this.listParent.childNodes[1];
+		var combobox = this.listParent.parentNode;
+		
+		combobox.style.width = width;
+		iframe.style.width = width;
+		positionElem.style.width = width;
+		
+		this.list.style.width = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr");
+			
+		//this.list.style.width = width;
+	},
+	
 	setPosition : function(fieldTop, fieldLeft, fieldHeight) {
 		var docHeight = Richfaces.getDocumentHeight();
 		var comBottom = fieldTop + fieldHeight;

Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-11 18:10:58 UTC (rev 5314)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-11 18:14:46 UTC (rev 5315)
@@ -159,10 +159,30 @@
 	    	}
 	    	variables.setVariable("itemSelectedClass", itemSelectedClass);
 	      	
-    		
+	    	String curWidth = null;
+	    	curWidth = listWidth;
+    		if (listWidth == null) {
+    			curWidth = width;
+    		}
+    		variables.setVariable("curWidth", curWidth);
 		]]>
     </jsp:scriptlet>
-			                					
+	<jsp:scriptlet>
+		<![CDATA[
+         if (listWidth == null) {
+        ]]>
+	</jsp:scriptlet>
+	<style>
+		.rich-combobox-item {
+			overflow-x: hidden;
+			width: #{curWidth};
+		}
+	</style>
+	<jsp:scriptlet>
+		<![CDATA[
+         }
+		]]>
+	</jsp:scriptlet>
 	<div id="#{clientId}" class="rich-combobox-font rich-combobox-shell #{styleClass}" style="width:#{listWidth}; #{style}">
 		<div class="rich-combobox-font rich-combobox-shell" style="width:#{width}">
 			<input id="comboboxField#{clientId}" 
@@ -189,7 +209,7 @@
 			<iframe class="rich-combobox-list-scroll rich-combobox-list-position" frameborder="0" style="width:#{listWidth};"/>
 			<div id="listPosition#{clientId}" class="rich-combobox-list-position" style="width:#{listWidth};">
 				<div id="listDecoration#{clientId}" class="rich-combobox-list-decoration">
-					<div id="list#{clientId}" class="rich-combobox-list-scroll">
+					<div id="list#{clientId}" class="rich-combobox-list-scroll" style="width:#{listWidth};">
 						<f:call name="encodeItems"/>
 					</div>
 				</div>




More information about the richfaces-svn-commits mailing list