summaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2011-08-11 12:48:51 +0000
committerArtur Signell <artur.signell@itmill.com>2011-08-11 12:48:51 +0000
commit703f6c937387bf1011905ed0acaa930d42e1afc7 (patch)
treeec704cc43b8b09545c0e40f5ea20be2fc1ddd53d /src/com/vaadin/ui
parent1f2ac63ff8976bb2de8e00605ab2e9ffa4eaf342 (diff)
downloadvaadin-framework-703f6c937387bf1011905ed0acaa930d42e1afc7.tar.gz
vaadin-framework-703f6c937387bf1011905ed0acaa930d42e1afc7.zip
#5916 Table.ColumnGenerator should allow generation of plain text
svn changeset:20302/svn branch:6.7
Diffstat (limited to 'src/com/vaadin/ui')
-rw-r--r--src/com/vaadin/ui/Table.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/com/vaadin/ui/Table.java b/src/com/vaadin/ui/Table.java
index 572dececc3..1098b47e1c 100644
--- a/src/com/vaadin/ui/Table.java
+++ b/src/com/vaadin/ui/Table.java
@@ -1559,7 +1559,12 @@ public class Table extends AbstractSelect implements Action.Container,
ColumnGenerator cg = columnGenerators
.get(colids[j]);
value = cg.generateCell(this, id, colids[j]);
-
+ if (!(value instanceof Component)
+ && !(value instanceof String)) {
+ // Avoid errors if a generator returns something
+ // other than a Component or a String
+ value = value.toString();
+ }
} else if (iscomponent[j]) {
value = p.getValue();
listenProperty(p, oldListenedProperties);
@@ -3845,9 +3850,11 @@ public class Table extends AbstractSelect implements Action.Container,
* @param columnId
* the id for the generated column (as specified in
* addGeneratedColumn)
- * @return
+ * @return A {@link Component} that should be rendered in the cell or a
+ * {@link String} that should be displayed in the cell. Other
+ * return values are not supported.
*/
- public abstract Component generateCell(Table source, Object itemId,
+ public abstract Object generateCell(Table source, Object itemId,
Object columnId);
}