]> source.dussan.org Git - vaadin-framework.git/commitdiff
fixed width with combobox, deprecated setColumns
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 14 Mar 2008 09:02:28 +0000 (09:02 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Fri, 14 Mar 2008 09:02:28 +0000 (09:02 +0000)
svn changeset:4047/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ui/IFilterSelect.java
src/com/itmill/toolkit/ui/Select.java

index 7e07c50d9414dd18dd75bff556919911d4dd3eba..4d30cb11e54eabf4797c4a3ae9c7a5ed3371f849 100644 (file)
@@ -612,13 +612,6 @@ public class IFilterSelect extends Composite implements Paintable,
         DOM.setStyleAttribute(spacer, "overflow", "hidden");
         DOM.appendChild(panel.getElement(), spacer);
 
-        // Set columns (width) is given
-        if (uidl.hasAttribute("cols")) {
-            DOM.setStyleAttribute(getElement(), "width", uidl
-                    .getIntAttribute("cols")
-                    + "em");
-        }
-
     }
 
     public void onSuggestionSelected(FilterSelectSuggestion suggestion) {
index 791b2d463cfc0aad64d2a4124444649abf178d32..41b203f4b5a95c0b7ed60fdb7091cf58cb269622 100644 (file)
@@ -126,11 +126,6 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering {
             }
         }
 
-        // Adds the number of columns
-        if (columns != 0) {
-            target.addAttribute("cols", columns);
-        }
-
         // Constructs selected keys array
         String[] selectedKeys;
         if (isMultiSelect()) {
@@ -425,10 +420,15 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering {
     }
 
     /**
+     * Note, one should use more generic setWidth(String) method instead of
+     * this. This now days actually converts columns to width with em css unit.
+     * 
      * Sets the number of columns in the editor. If the number of columns is set
      * 0, the actual number of displayed columns is determined implicitly by the
      * adapter.
      * 
+     * @deprecated
+     * 
      * @param columns
      *                the number of columns to set.
      */
@@ -438,10 +438,15 @@ public class Select extends AbstractSelect implements AbstractSelect.Filtering {
         }
         if (this.columns != columns) {
             this.columns = columns;
+            setWidth(columns, Select.UNITS_EM);
             requestRepaint();
         }
     }
 
+    /**
+     * @deprecated see setter function
+     * @return
+     */
     public int getColumns() {
         return columns;
     }