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.

WideSelectableTable.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.tests.components.TestBase;
  3. import com.vaadin.ui.Table;
  4. import com.vaadin.ui.VerticalLayout;
  5. public class WideSelectableTable extends TestBase {
  6. @Override
  7. protected void setup() {
  8. final int NUMBER_OF_COLS = 50;
  9. // mainWindow.setSizeFull();
  10. // setMainWindow(mainWindow);
  11. Table ptable = new Table();
  12. for (int colcount = 0; colcount < NUMBER_OF_COLS; colcount++) {
  13. String col = "COL_" + colcount + "";
  14. ptable.addContainerProperty(col, String.class, "--");
  15. ptable.addItem(colcount + "-").getItemProperty(col)
  16. .setValue("--" + colcount + "");
  17. }
  18. ptable.setSelectable(true);
  19. ptable.setMultiSelect(true);
  20. ptable.setColumnReorderingAllowed(false);
  21. ptable.setImmediate(true);
  22. ptable.setWidth("100%");
  23. ptable.setPageLength(5);
  24. VerticalLayout vl = new VerticalLayout();
  25. vl.addComponent(ptable);
  26. addComponent(vl);
  27. }
  28. @Override
  29. protected String getDescription() {
  30. return "A wide table scrolls to the beginning when sorting a column at the beginning when sorting a column at the end";
  31. }
  32. @Override
  33. protected Integer getTicketNumber() {
  34. return 6788;
  35. }
  36. }