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.

TableInFormLayoutCausesScrolling.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.vaadin.tests.components.formlayout;
  2. import com.vaadin.tests.components.AbstractTestCase;
  3. import com.vaadin.ui.FormLayout;
  4. import com.vaadin.ui.Table;
  5. import com.vaadin.ui.TextField;
  6. import com.vaadin.ui.Window;
  7. public class TableInFormLayoutCausesScrolling extends AbstractTestCase {
  8. @Override
  9. public void init() {
  10. // Window Initialization.
  11. final Window window = new Window("Main Window");
  12. setMainWindow(window);
  13. // FormLayout creation
  14. final FormLayout fl = new FormLayout();
  15. window.setContent(fl);
  16. // Add 20 TextField
  17. for (int i = 20; i-- > 0;) {
  18. fl.addComponent(new TextField());
  19. }
  20. // Add 1 selectable table with some items
  21. final Table table = new Table();
  22. table.setSelectable(true);
  23. table.addContainerProperty("item", String.class, "");
  24. for (int i = 50; i-- > 0;) {
  25. table.addItem(new String[] { "item" + i }, i);
  26. }
  27. window.addComponent(table);
  28. }
  29. @Override
  30. protected String getDescription() {
  31. return "Clicking in the Table should not cause the page to scroll";
  32. }
  33. @Override
  34. protected Integer getTicketNumber() {
  35. return 7309;
  36. }
  37. }