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.

TableSelectPagingOff.java 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package com.vaadin.tests.components.table;
  2. import java.util.Arrays;
  3. import java.util.Collection;
  4. import com.vaadin.tests.components.TestBase;
  5. import com.vaadin.v7.data.util.BeanItemContainer;
  6. import com.vaadin.v7.ui.Table;
  7. public class TableSelectPagingOff extends TestBase {
  8. @Override
  9. protected void setup() {
  10. Table table = new Table();
  11. BeanItemContainer<MyBean> dataSource = new BeanItemContainer<>(
  12. getBeans());
  13. table.setContainerDataSource(dataSource);
  14. table.setSelectable(true);
  15. table.setPageLength(0);
  16. addComponent(table);
  17. }
  18. private Collection<MyBean> getBeans() {
  19. return Arrays.asList(new MyBean("a", "description a"),
  20. new MyBean("b", "description b"),
  21. new MyBean("c", "description c"),
  22. new MyBean("d", "description d"));
  23. }
  24. public class MyBean {
  25. private String name;
  26. private String description;
  27. public MyBean() {
  28. }
  29. public MyBean(String name, String description) {
  30. this.name = name;
  31. this.description = description;
  32. }
  33. public String getName() {
  34. return name;
  35. }
  36. public void setName(String name) {
  37. this.name = name;
  38. }
  39. public String getDescription() {
  40. return description;
  41. }
  42. public void setDescription(String description) {
  43. this.description = description;
  44. }
  45. }
  46. @Override
  47. protected String getDescription() {
  48. return "No flickering (scrollbars) should happen on select";
  49. }
  50. @Override
  51. protected Integer getTicketNumber() {
  52. return 5746;
  53. }
  54. }