diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-07-10 11:56:40 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-07-10 11:56:40 +0300 |
commit | aba7d2b2285865cd86cbdc722732cc0657b44634 (patch) | |
tree | 3c8a54192965e5fad2e8ea3c30f8d8fa5e15b795 /uitest | |
parent | efa97eafaed3a6803535ecb867b1dd90792d233b (diff) | |
download | vaadin-framework-aba7d2b2285865cd86cbdc722732cc0657b44634.tar.gz vaadin-framework-aba7d2b2285865cd86cbdc722732cc0657b44634.zip |
Fix modifying rows in GridBasicFeatures
Change-Id: If19200b02720a7fe3a0b2bd1e944f21aa12bdb98
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/grid/GridBasicFeatures.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/GridBasicFeatures.java index 5800c83738..a7dad4795f 100644 --- a/uitest/src/com/vaadin/tests/components/grid/GridBasicFeatures.java +++ b/uitest/src/com/vaadin/tests/components/grid/GridBasicFeatures.java @@ -26,6 +26,7 @@ import java.util.Locale; import java.util.Random; import com.vaadin.data.Item; +import com.vaadin.data.Property; import com.vaadin.data.util.IndexedContainer; import com.vaadin.shared.ui.grid.HeightMode; import com.vaadin.shared.ui.grid.SortDirection; @@ -420,27 +421,37 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> { createClickAction("Modify first row (getItemProperty)", "Body rows", new Command<Grid, String>() { + @SuppressWarnings("unchecked") @Override public void execute(Grid c, String value, Object data) { Object firstItemId = ds.getIdByIndex(0); Item item = ds.getItem(firstItemId); for (int i = 0; i < COLUMNS; i++) { - item.getItemProperty(getColumnProperty(i)) - .setValue("modified: " + i); + Property<?> property = item + .getItemProperty(getColumnProperty(i)); + if (property.getType().equals(String.class)) { + ((Property<String>) property) + .setValue("modified: " + i); + } } } }, null); createClickAction("Modify first row (getContainerProperty)", "Body rows", new Command<Grid, String>() { + @SuppressWarnings("unchecked") @Override public void execute(Grid c, String value, Object data) { Object firstItemId = ds.getIdByIndex(0); for (Object containerPropertyId : ds .getContainerPropertyIds()) { - ds.getContainerProperty(firstItemId, - containerPropertyId).setValue( - "modified: " + containerPropertyId); + Property<?> property = ds.getContainerProperty( + firstItemId, containerPropertyId); + if (property.getType().equals(String.class)) { + ((Property<String>) property) + .setValue("modified: " + + containerPropertyId); + } } } }, null); |