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.

ExpandChangeReattach.java 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * Copyright 2012 Vaadin Ltd.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  5. * use this file except in compliance with the License. You may obtain a copy of
  6. * the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  12. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  13. * License for the specific language governing permissions and limitations under
  14. * the License.
  15. */
  16. package com.vaadin.tests.components.orderedlayout;
  17. import com.vaadin.server.VaadinRequest;
  18. import com.vaadin.tests.components.AbstractReindeerTestUI;
  19. import com.vaadin.tests.util.TestUtils;
  20. import com.vaadin.ui.Button;
  21. import com.vaadin.ui.Button.ClickEvent;
  22. import com.vaadin.ui.VerticalLayout;
  23. import com.vaadin.v7.ui.Table;
  24. public class ExpandChangeReattach extends AbstractReindeerTestUI {
  25. @Override
  26. protected void setup(VaadinRequest request) {
  27. final VerticalLayout verticalLayout = new VerticalLayout();
  28. verticalLayout.setHeight(null);
  29. Table table = new Table("Table", TestUtils.getISO3166Container());
  30. verticalLayout.addComponent(table);
  31. verticalLayout.addComponent(
  32. new Button("Toggle expand logic", new Button.ClickListener() {
  33. @Override
  34. public void buttonClick(ClickEvent event) {
  35. if (verticalLayout.getHeight() == -1) {
  36. verticalLayout.setHeight("900px");
  37. } else {
  38. verticalLayout.setHeight(null);
  39. }
  40. }
  41. }));
  42. addComponent(verticalLayout);
  43. }
  44. @Override
  45. protected String getTestDescription() {
  46. return "Table should not forget its scroll position when it is temporarily detached from the DOM because an ordered layout changes expand modes.";
  47. }
  48. @Override
  49. protected Integer getTicketNumber() {
  50. return Integer.valueOf(10489);
  51. }
  52. }