summaryrefslogtreecommitdiffstats
path: root/server/src
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2013-08-20 15:47:54 +0300
committerVaadin Code Review <review@vaadin.com>2013-09-02 11:14:14 +0000
commita24d391349354579a83ab2f6b50e9552fbe2566a (patch)
tree2857d39024e9c1b4b82da3b464ac4700dd4786fb /server/src
parentf7ee8fb1d2c6b6d51e03486968f3bc20e7c44b4d (diff)
downloadvaadin-framework-a24d391349354579a83ab2f6b50e9552fbe2566a.tar.gz
vaadin-framework-a24d391349354579a83ab2f6b50e9552fbe2566a.zip
Table ignores Container updates while painting (#12258)
Vaadin threw an IllegalStateException if a Container was updated while Table was being painted. SQLContainer was known to invalidate its cached size during a Table repaint, resulting in an ItemSetChangeEvent. This fix has been copied over from how ComboBox handles this situation. Change-Id: I04af71a5ea3844da245cb9e31ada4a30ff704619
Diffstat (limited to 'server/src')
-rw-r--r--server/src/com/vaadin/ui/Table.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java
index 3507e6b0a5..bd2b7828de 100644
--- a/server/src/com/vaadin/ui/Table.java
+++ b/server/src/com/vaadin/ui/Table.java
@@ -564,6 +564,8 @@ public class Table extends AbstractSelect implements Action.Container,
private List<Throwable> exceptionsDuringCachePopulation = new ArrayList<Throwable>();
+ private boolean isBeingPainted;
+
/* Table constructors */
/**
@@ -3166,6 +3168,15 @@ public class Table extends AbstractSelect implements Action.Container,
@Override
public void paintContent(PaintTarget target) throws PaintException {
+ isBeingPainted = true;
+ try {
+ doPaintContent(target);
+ } finally {
+ isBeingPainted = false;
+ }
+ }
+
+ private void doPaintContent(PaintTarget target) throws PaintException {
/*
* Body actions - Actions which has the target null and can be invoked
* by right clicking on the table body.
@@ -4394,6 +4405,10 @@ public class Table extends AbstractSelect implements Action.Container,
@Override
public void containerItemSetChange(Container.ItemSetChangeEvent event) {
+ if (isBeingPainted) {
+ return;
+ }
+
super.containerItemSetChange(event);
// super method clears the key map, must inform client about this to
@@ -4416,6 +4431,10 @@ public class Table extends AbstractSelect implements Action.Container,
@Override
public void containerPropertySetChange(
Container.PropertySetChangeEvent event) {
+ if (isBeingPainted) {
+ return;
+ }
+
disableContentRefreshing();
super.containerPropertySetChange(event);