From: Joonas Lehtinen Date: Mon, 1 Oct 2007 15:09:19 +0000 (+0000) Subject: Fixes #945 X-Git-Tag: 6.7.0.beta1~5937 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd305020efbe38a02477bfe2d97ea982b978d66d;p=vaadin-framework.git Fixes #945 svn changeset:2402/svn branch:trunk --- diff --git a/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java b/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java index d039fb44e8..67f2e8ae82 100644 --- a/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java +++ b/src/com/itmill/toolkit/terminal/gwt/server/CommunicationManager.java @@ -165,8 +165,9 @@ public class CommunicationManager implements Paintable.RepaintRequestListener, try { iter = upload.getItemIterator(request); - /* ATM this loop is run only once as we are uploading one file per - * request. + /* + * ATM this loop is run only once as we are uploading one file per + * request. */ while (iter.hasNext()) { FileItemStream item = iter.next(); @@ -207,9 +208,10 @@ public class CommunicationManager implements Paintable.RepaintRequestListener, }; - // tell UploadProgressListener which component is receiving file + // tell UploadProgressListener which component is receiving + // file pl.setUpload(uploadComponent); - + uploadComponent.receiveUpload(upstream); } } @@ -241,6 +243,12 @@ public class CommunicationManager implements Paintable.RepaintRequestListener, boolean repaintAll = (request.getParameter(GET_PARAM_REPAINT_ALL) != null) || request.getSession().isNew(); + // If repaint is requested, clean all ids + if (repaintAll) { + idPaintableMap.clear(); + paintableIdMap.clear(); + } + OutputStream out = response.getOutputStream(); PrintWriter outWriter = new PrintWriter(new BufferedWriter( new OutputStreamWriter(out, "UTF-8"))); @@ -293,7 +301,8 @@ public class CommunicationManager implements Paintable.RepaintRequestListener, outWriter.print("\"changes\":["); - paintTarget = new JsonPaintTarget(this, outWriter, !repaintAll); + paintTarget = new JsonPaintTarget(this, outWriter, + !repaintAll); // Paints components Set paintables; @@ -905,7 +914,7 @@ public class CommunicationManager implements Paintable.RepaintRequestListener, return paintableIdMap.containsKey(paintable); } - + /** * * @return @@ -1177,6 +1186,7 @@ public class CommunicationManager implements Paintable.RepaintRequestListener, */ private class UploadProgressListener implements ProgressListener { Upload uploadComponent; + boolean updated = false; public void setUpload(Upload u) {