summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin/ui/Grid.java
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin/ui/Grid.java')
-rw-r--r--server/src/com/vaadin/ui/Grid.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index 96884d7fd5..2c442d6e43 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -4139,8 +4139,18 @@ public class Grid extends AbstractComponent implements SelectionNotifier,
if (datasource.getContainerPropertyIds().contains(propertyId)
&& !columns.containsKey(propertyId)) {
appendColumn(propertyId);
- } else {
+ } else if (defaultContainer) {
addColumnProperty(propertyId, String.class, "");
+ } else {
+ if (columns.containsKey(propertyId)) {
+ throw new IllegalStateException("A column for property id '"
+ + propertyId.toString()
+ + "' already exists in this grid");
+ } else {
+ throw new IllegalStateException("Property id '"
+ + propertyId.toString()
+ + "' does not exist in the container");
+ }
}
// Inform the data provider of this new column.