]> source.dussan.org Git - vaadin-framework.git/commitdiff
Now could items right when nullselectionallowed (1-9/10 -> 1-9/9). Fixes #1453
authorMarc Englund <marc.englund@itmill.com>
Fri, 29 Feb 2008 07:28:06 +0000 (07:28 +0000)
committerMarc Englund <marc.englund@itmill.com>
Fri, 29 Feb 2008 07:28:06 +0000 (07:28 +0000)
svn changeset:3946/svn branch:trunk

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

index 63d30768cce5f42af500e3b5290241ab92132395..34ed706f350d3d6baee27f8cd7f4e835e01dfdbd 100644 (file)
@@ -137,13 +137,17 @@ public class IFilterSelect extends Composite implements Paintable,
             int y = tb.getAbsoluteTop();
             y += tb.getOffsetHeight();
             setPopupPosition(x, y);
-            final int first = currentPage * PAGELENTH + 1;
+            final int first = currentPage * PAGELENTH
+                    + (nullSelectionAllowed && currentPage > 0 ? 0 : 1);
             final int last = first + currentSuggestions.size() - 1;
             final int matches = totalSuggestions
                     - (nullSelectionAllowed ? 1 : 0);
             if (last > 0) {
+                // nullsel not counted, as requested by user
                 DOM.setInnerText(status, (totalSuggestions == 0 ? 0 : first)
-                        + "-" + last + "/" + matches);
+                        + "-"
+                        + (nullSelectionAllowed && currentPage == 0 ? last - 1
+                                : last) + "/" + matches);
             } else {
                 DOM.setInnerText(status, "");
             }