You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SortLongTable.java 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.tests.components.AbstractTestCase;
  3. import com.vaadin.ui.LegacyWindow;
  4. import com.vaadin.ui.Table;
  5. import com.vaadin.ui.VerticalLayout;
  6. public class SortLongTable extends AbstractTestCase {
  7. @Override
  8. public void init() {
  9. final int NUMBER_OF_ROWS = 100; // Works with 10
  10. LegacyWindow mainWindow = new LegacyWindow("Table Sort Test");
  11. mainWindow.setSizeFull();
  12. setMainWindow(mainWindow);
  13. Table ptable = new Table();
  14. ptable.addContainerProperty("Sort_me_please", String.class, "--");
  15. for (int i = NUMBER_OF_ROWS - 1; i >= 0; i--) {
  16. ptable.addItem("" + i).getItemProperty("Sort_me_please")
  17. .setValue("Value " + String.format("%02d", i));
  18. }
  19. ptable.setWidth("100%");
  20. ptable.setPageLength(NUMBER_OF_ROWS);
  21. VerticalLayout vl = new VerticalLayout();
  22. vl.addComponent(ptable);
  23. mainWindow.addComponent(vl);
  24. }
  25. @Override
  26. protected String getDescription() {
  27. return "Clicking on the header should sort the column. It should not cause the headers to be scrolled out of view.";
  28. }
  29. @Override
  30. protected Integer getTicketNumber() {
  31. return 6367;
  32. }
  33. }