]> source.dussan.org Git - vaadin-framework.git/commitdiff
Filterselect says "0-0/0" instead of "1-0/0" when empty.
authorMarc Englund <marc.englund@itmill.com>
Fri, 23 Nov 2007 10:38:39 +0000 (10:38 +0000)
committerMarc Englund <marc.englund@itmill.com>
Fri, 23 Nov 2007 10:38:39 +0000 (10:38 +0000)
svn changeset:2908/svn branch:trunk

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

index 2f458123ca89334c4108d1d0f1a2497e6932e36a..e208e918467a08dd490e980266aa4e60925c7eff 100644 (file)
@@ -128,8 +128,8 @@ public class IFilterSelect extends Composite implements Paintable,
             setPopupPosition(x, y);
             int first = currentPage * PAGELENTH + 1;
             int last = first + currentSuggestions.size() - 1;
-            DOM.setInnerText(status, first + "-" + last + "/"
-                    + totalSuggestions);
+            DOM.setInnerText(status, (totalSuggestions == 0 ? 0 : first) + "-"
+                    + last + "/" + totalSuggestions);
             setPrevButtonActive(first > 1);
             setNextButtonActive(last < totalSuggestions);
 
@@ -659,25 +659,25 @@ public class IFilterSelect extends Composite implements Paintable,
      * Calculate minumum width for FilterSelect textarea
      */
     private native int minWidth(String captions) /*-{
-                                                       if(!captions || captions.length <= 0)
-                                                               return 0;
-                                                       captions = captions.split("|");
-                                                       var d = $wnd.document.createElement("div");
-                                                       var html = "";
-                                                       for(var i=0; i < captions.length; i++) {
-                                                               html += "<div>" + captions[i] + "</div>";
-                                                               // TODO apply same CSS classname as in suggestionmenu
-                                                       }
-                                                       d.style.position = "absolute";
-                                                       d.style.top = "0";
-                                                       d.style.left = "0";
-                                                       d.style.visibility = "hidden";
-                                                       d.innerHTML = html;
-                                                       $wnd.document.body.appendChild(d);
-                                                       var w = d.offsetWidth;
-                                                       $wnd.document.body.removeChild(d);
-                                                       return w;
-                                                    }-*/;
+                                                               if(!captions || captions.length <= 0)
+                                                                       return 0;
+                                                               captions = captions.split("|");
+                                                               var d = $wnd.document.createElement("div");
+                                                               var html = "";
+                                                               for(var i=0; i < captions.length; i++) {
+                                                                       html += "<div>" + captions[i] + "</div>";
+                                                                       // TODO apply same CSS classname as in suggestionmenu
+                                                               }
+                                                               d.style.position = "absolute";
+                                                               d.style.top = "0";
+                                                               d.style.left = "0";
+                                                               d.style.visibility = "hidden";
+                                                               d.innerHTML = html;
+                                                               $wnd.document.body.appendChild(d);
+                                                               var w = d.offsetWidth;
+                                                               $wnd.document.body.removeChild(d);
+                                                               return w;
+                                                       }-*/;
 
     public void onFocus(Widget sender) {
         // NOP