Reviewers: jgw,

Description:
The Mail sample doesn't resize the table containing the mail list to the
number of emails on the last page.  This results in a vertical scroll
bar that doesn't go away when it isn't needed.

Fix:
====
We now resize the table dynamically.

Testing:
========
Verified manually.

Please review this at http://gwt-code-reviews.appspot.com/117804

Affected files:
   samples/mail/src/com/google/gwt/sample/mail/client/MailList.java


Index: samples/mail/src/com/google/gwt/sample/mail/client/MailList.java
===================================================================
--- samples/mail/src/com/google/gwt/sample/mail/client/MailList.java     
(revision 7242)
+++ samples/mail/src/com/google/gwt/sample/mail/client/MailList.java     
(working copy)
@@ -131,15 +131,6 @@
      // Initialize the table.
      table.getColumnFormatter().setWidth(0, "128px");
      table.getColumnFormatter().setWidth(1, "192px");
-
-    for (int i = 0; i < VISIBLE_EMAIL_COUNT; ++i) {
-      table.setText(i, 0, "");
-      table.setText(i, 1, "");
-      table.setText(i, 2, "");
-      table.getCellFormatter().setWordWrap(i, 0, false);
-      table.getCellFormatter().setWordWrap(i, 1, false);
-      table.getCellFormatter().setWordWrap(i, 2, false);
-    }
    }

    /**
@@ -208,9 +199,7 @@

      // Clear any remaining slots.
      for (; i < VISIBLE_EMAIL_COUNT; ++i) {
-      table.setHTML(i, 0, "&nbsp;");
-      table.setHTML(i, 1, "&nbsp;");
-      table.setHTML(i, 2, "&nbsp;");
+      table.removeRow(table.getRowCount() - 1);
      }
    }
  }


-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to