[richfaces-svn-commits] JBoss Rich Faces SVN: r5624 - in trunk/sandbox/ui/combobox/src/main: templates and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Fri Jan 25 06:53:54 EST 2008


Author: abelevich
Date: 2008-01-25 06:53:53 -0500 (Fri, 25 Jan 2008)
New Revision: 5624

Modified:
   trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
   trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
Log:
fix setWidth method

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-25 11:52:29 UTC (rev 5623)
+++ trunk/sandbox/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js	2008-01-25 11:53:53 UTC (rev 5624)
@@ -488,12 +488,13 @@
 	setWidth : function(width) {
 		var positionElem = this.listParent.childNodes[2];
 		var combobox = this.listParent.parentNode;
-		
-		combobox.style.width = width;
-		this.iframe.style.width = width;
+	
 		//positionElem.style.width = width;
-		
-		this.list.style.width = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr");
+		var correction = parseInt(width) - Richfaces.getBorderWidth(positionElem.firstChild, "lr") - Richfaces.getPaddingWidth(positionElem.firstChild, "lr") + "px"; 
+		this.list.style.width = correction;
+		combobox.style.width = correction;
+		this.iframe.style.width = correction;
+		 
 	},
 	
 	setPosition : function(fieldTop, fieldLeft, fieldHeight) {

Modified: trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-25 11:52:29 UTC (rev 5623)
+++ trunk/sandbox/ui/combobox/src/main/templates/combobox.jspx	2008-01-25 11:53:53 UTC (rev 5624)
@@ -59,9 +59,9 @@
 	    	String listWidth = (String) component.getAttributes().get("listWidth");
 	    	
 	    	if (listWidth == null || listWidth.length() == 0 || listWidth.trim().startsWith("0")) {
-	    		String listCorrection =  width.substring(0,width.indexOf("px"));  
-	    	    listCorrection = (Integer.parseInt(listCorrection) - 2) + "px";
-	    		listWidth = listCorrection;	    	   		
+	//    		String listCorrection =  width.substring(0,width.indexOf("px"));  
+	//    	    listCorrection = (Integer.parseInt(listCorrection) - 2) + "px";
+	    		listWidth = width;	    	   		
 	    	} else {
 	    		listWidth = HtmlUtil.qualifySize(listWidth);
 	    	}




More information about the richfaces-svn-commits mailing list