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.

TableScrollsOnSelection.java 1.1KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractReindeerTestUI;
  4. import com.vaadin.v7.data.Item;
  5. import com.vaadin.v7.data.util.IndexedContainer;
  6. import com.vaadin.v7.ui.Table;
  7. public class TableScrollsOnSelection extends AbstractReindeerTestUI {
  8. @Override
  9. protected void setup(VaadinRequest request) {
  10. getContent().setSizeUndefined();
  11. IndexedContainer cont = new IndexedContainer();
  12. cont.addContainerProperty("number", String.class, null);
  13. for (int i = 0; i < 80; i++) {
  14. Item item = cont.addItem(i);
  15. item.getItemProperty("number").setValue(i + "");
  16. }
  17. Table table = new Table();
  18. table.setPageLength(0);
  19. table.setContainerDataSource(cont);
  20. table.setSelectable(true);
  21. addComponent(table);
  22. }
  23. @Override
  24. protected String getTestDescription() {
  25. return "The scroll position should not change when an item is selected in a Table that is higher than the view.";
  26. }
  27. @Override
  28. protected Integer getTicketNumber() {
  29. return 6197;
  30. }
  31. }