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.

HiddenComponentCells.java 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package com.vaadin.tests.components.table;
  2. import com.vaadin.server.VaadinRequest;
  3. import com.vaadin.tests.components.AbstractReindeerTestUI;
  4. import com.vaadin.ui.Label;
  5. import com.vaadin.v7.data.Item;
  6. import com.vaadin.v7.ui.Table;
  7. public class HiddenComponentCells extends AbstractReindeerTestUI {
  8. @Override
  9. protected void setup(VaadinRequest request) {
  10. final Table tbl = new Table();
  11. tbl.addContainerProperty("col1", Label.class, null);
  12. tbl.addContainerProperty("col2", Label.class, null);
  13. for (int rows = 0; rows < 20; rows++) {
  14. Item item = tbl.addItem(rows);
  15. Label cb = new Label("col1");
  16. cb.setVisible(rows % 2 == 0);
  17. item.getItemProperty("col1").setValue(cb);
  18. cb = new Label("col2");
  19. cb.setVisible((rows + 1) % 2 == 0);
  20. item.getItemProperty("col2").setValue(cb);
  21. }
  22. addComponent(tbl);
  23. }
  24. @Override
  25. protected String getTestDescription() {
  26. return "Hiding a component in the Table should not cause exceptions. <br/> Every other cell in the table should be hidden.";
  27. }
  28. @Override
  29. protected Integer getTicketNumber() {
  30. return 12119;
  31. }
  32. }