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.

TreeTableComponentsDisappearWhenScrolling.java 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package com.vaadin.tests.components.treetable;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.shared.ui.ContentMode;
  4. import com.vaadin.tests.components.AbstractTestUI;
  5. import com.vaadin.ui.Button;
  6. import com.vaadin.ui.Label;
  7. import com.vaadin.v7.ui.TreeTable;
  8. public class TreeTableComponentsDisappearWhenScrolling extends AbstractTestUI {
  9. @Override
  10. protected void setup(VaadinRequest request) {
  11. Label label = new Label(getDescription(), ContentMode.HTML);
  12. addComponent(label);
  13. TreeTable table = new TreeTable();
  14. table.setSizeFull();
  15. table.setCacheRate(1.1);
  16. table.addContainerProperty(0, Button.class, null);
  17. for (int i = 0; i < 100; i++) {
  18. table.addItem(new Object[] { new Button(Integer.toString(i)) }, i);
  19. if ((i + 1) % 5 == 0) {
  20. for (int j = 0; j < 4; j++) {
  21. table.setParent(i - j, i - 4);
  22. }
  23. }
  24. }
  25. addComponent(table);
  26. }
  27. @Override
  28. public String getDescription() {
  29. return "Expand nodes and scroll all the way down, then slowly back up"
  30. + ". More often than"
  31. + " not this results in 'flattening' of several rows. This is "
  32. + "due to component connectors being unregistered on "
  33. + "components, which are on visible table rows.";
  34. }
  35. @Override
  36. protected Integer getTicketNumber() {
  37. return 7964;
  38. }
  39. }