diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-02-22 11:35:19 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-02-22 11:35:19 +0200 |
commit | ca1bfa7511e35fad802271604158afd7be6531d0 (patch) | |
tree | f0c68b320cff5051a4a8dc4d5827f55276b1d73c /uitest/src/main/java/com/vaadin/v7 | |
parent | e76d2e8953e8bfb80018019dc5497e7760313403 (diff) | |
download | vaadin-framework-ca1bfa7511e35fad802271604158afd7be6531d0.tar.gz vaadin-framework-ca1bfa7511e35fad802271604158afd7be6531d0.zip |
Pick changes from 7.7.7 (#8577)
* Fix java packaging order (#106)
Closes vaadin/archetypes#113
* Use proper UTF-8 encoding for Content-Disposition filenames (#19527) (#6607)
* Enable changing the backing bean for BeanItem (#4302) (#77)
When storing a bean to the database, you typically get a new and updated
bean instance back. By allowing to change the bean instance, we make it
possible to just update the single BeanItem instance which can be used
in many places.
* Make AtmospherePushConnection methods public (#7973)
There is no sensible way to use a custom version of APC, so protected
access does not help in any way to access the underlying resource and/or
connected UI.
* Use correct indexes in multiselect checkboxes after removing rows (#8072)
Fixes #8011
* Fix removal of hidden Grid columns (#8071)
Fixes #8018
* Call error handler for exceptions in UI.init() (#8055)
Fixes #4995
* Render font icon correctly on the 'more' menu item (#8126)
* Render font icon correctly on the 'more' menu item
Fixes #8125
* Reopen Grid details on attach, fixes #8015 (#8074)
Fixes #8015
* Fix broken Grid tests after picking changes from 7.7.7
Removed duplicate setDetailsVisible calls from onDetach
* Correctly detach components in merged cells when a static row is removed (#8142)
Fixes #8140
Diffstat (limited to 'uitest/src/main/java/com/vaadin/v7')
-rw-r--r-- | uitest/src/main/java/com/vaadin/v7/tests/components/grid/RemoveHiddenColumn.java | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/v7/tests/components/grid/RemoveHiddenColumn.java b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/RemoveHiddenColumn.java new file mode 100644 index 0000000000..1c053ca8d7 --- /dev/null +++ b/uitest/src/main/java/com/vaadin/v7/tests/components/grid/RemoveHiddenColumn.java @@ -0,0 +1,60 @@ +package com.vaadin.v7.tests.components.grid; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.tests.data.bean.Person; +import com.vaadin.tests.data.bean.Sex; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.v7.data.util.BeanItemContainer; +import com.vaadin.v7.ui.Grid; +import com.vaadin.v7.ui.Grid.Column; + +public class RemoveHiddenColumn extends AbstractTestUIWithLog { + + private final Grid testGrid = new Grid(); + private final Button testBtn = new Button("updateGrid"); + private final Button testBtn2 = new Button("show/hide Grid"); + private final HorizontalLayout buttonBar = new HorizontalLayout(testBtn, + testBtn2); + private final VerticalLayout mainLayout = new VerticalLayout(testGrid, + buttonBar); + + @Override + protected void setup(final VaadinRequest request) { + final Grid grid = new Grid(); + final BeanItemContainer<Person> bic = new BeanItemContainer<Person>( + Person.class); + grid.setContainerDataSource(bic); + grid.setColumns("firstName", "lastName", "email", "age"); + + grid.getColumn("firstName").setHidden(true); + grid.getColumn("email").setHidden(true); + + Button addRow = new Button("Add data row", new ClickListener() { + @Override + public void buttonClick(ClickEvent e) { + bic.addBean(new Person("first", "last", "email", 42, Sex.FEMALE, + null)); + + } + }); + addRow.setId("add"); + Button removeColumn = new Button("Remove first column", + new ClickListener() { + @Override + public void buttonClick(ClickEvent e) { + Column column = grid.getColumns().get(0); + log("Removed column '" + column.getHeaderCaption() + "'" + + (column.isHidden() ? " (hidden)" : "")); + grid.removeColumn(column.getPropertyId()); + } + }); + removeColumn.setId("remove"); + + addComponents(grid, addRow, removeColumn); + } +} |