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.

WindowScrollingUp.java 838B

123456789101112131415161718192021222324252627282930313233
  1. package com.vaadin.tests.components.window;
  2. import com.vaadin.tests.components.AbstractTestCase;
  3. import com.vaadin.ui.Button;
  4. import com.vaadin.ui.LegacyWindow;
  5. import com.vaadin.v7.ui.Table;
  6. public class WindowScrollingUp extends AbstractTestCase {
  7. @Override
  8. protected String getDescription() {
  9. return "Scroll down, click 'up' and the view should scroll to the top";
  10. }
  11. @Override
  12. protected Integer getTicketNumber() {
  13. return 4206;
  14. }
  15. @Override
  16. public void init() {
  17. Table table = new Table();
  18. table.setPageLength(50);
  19. final Button up = new Button("up");
  20. up.addClickListener(event -> up.getUI().setScrollTop(0));
  21. setMainWindow(new LegacyWindow(""));
  22. getMainWindow().addComponent(table);
  23. getMainWindow().addComponent(up);
  24. }
  25. }