]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed total&row attributes when nullselitem has been automatically removed.
authorMarc Englund <marc.englund@itmill.com>
Fri, 2 Nov 2007 14:51:51 +0000 (14:51 +0000)
committerMarc Englund <marc.englund@itmill.com>
Fri, 2 Nov 2007 14:51:51 +0000 (14:51 +0000)
svn changeset:2701/svn branch:trunk

src/com/itmill/toolkit/ui/Table.java

index 5a9762db9e1a10c52fc04032e3bbe6d31e153b50..13f5deb456bfffb3f44cf912c9340b964b126e66 100644 (file)
@@ -1469,6 +1469,13 @@ public class Table extends AbstractSelect implements Action.Container,
                boolean rowheads = getRowHeaderMode() != ROW_HEADER_MODE_HIDDEN;
                Object[][] cells = getVisibleCells();
                boolean iseditable = isEditable();
+               int rows = cells[0].length;
+
+               if (!isNullSelectionAllowed() && getNullSelectionItemId() != null
+                               && containsId(getNullSelectionItemId())) {
+                       total--;
+                       rows--;
+               }
 
                // selection support
                String[] selectedKeys;
@@ -1488,7 +1495,7 @@ public class Table extends AbstractSelect implements Action.Container,
                        target.addAttribute("selectmode", "none");
                }
                target.addAttribute("cols", cols);
-               target.addAttribute("rows", cells[0].length);
+               target.addAttribute("rows", rows);
                target
                                .addAttribute("firstrow",
                                                (this.reqFirstRowToPaint >= 0 ? this.reqFirstRowToPaint