]> source.dussan.org Git - vaadin-framework.git/commitdiff
#6685 servlet fix applied to portlets aswell
authorArtur Signell <artur.signell@itmill.com>
Thu, 24 Mar 2011 11:32:16 +0000 (11:32 +0000)
committerArtur Signell <artur.signell@itmill.com>
Thu, 24 Mar 2011 11:32:16 +0000 (11:32 +0000)
Clear the whole app div before adding any content

svn changeset:17909/svn branch:6.5

src/com/vaadin/terminal/gwt/client/ui/VView.java
src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java

index 70b5388405112f5bd38efb115ab87bdb77f4918a..b2be2a6daf6e4a5568dcaf1ea92daac74a6fe149 100644 (file)
@@ -675,14 +675,16 @@ public class VView extends SimplePanel implements Container, ResizeHandler,
         DOM.setElementProperty(getElement(), "tabIndex", "1");
 
         RootPanel root = RootPanel.get(rootPanelId);
-        Element rootElement = root.getElement();
-        if (rootElement.getChildCount() == 1) {
-            // Remove any "v-app-loading" div
-            rootElement.getChild(0).removeFromParent();
-        }
-        root.add(this);
+
+        // Remove the v-app-loading or any splash screen added inside the div by
+        // the user
+        root.getElement().setInnerHTML("");
+        // For backwards compatibility with static index pages only.
+        // No longer added by AbstractApplicationServlet/Portlet
         root.removeStyleName("v-app-loading");
 
+        root.add(this);
+
         BrowserInfo browser = BrowserInfo.get();
 
         // set focus to iview element by default to listen possible keyboard
index 4f93afff56bbabe64fd9a0a171439e11637d3a88..e64cd6f2435b5ab32cadbc7e36666fbb73f7c848 100644 (file)
@@ -926,8 +926,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
         String themeClass = "v-theme-"
                 + themeName.replaceAll("[^a-zA-Z0-9]", "");
 
-        String classNames = "v-app v-app-loading " + themeClass + " "
-                + appClass;
+        String classNames = "v-app " + themeClass + " " + appClass;
 
         String style = getApplicationProperty(PORTLET_PARAMETER_STYLE);
         String divStyle = "";
@@ -1225,7 +1224,9 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
             RenderResponse response, final BufferedWriter writer, String id,
             String classNames, String divStyle) throws IOException {
         writer.write("<div id=\"" + id + "\" class=\"" + classNames + "\" "
-                + divStyle + "></div>\n");
+                + divStyle + ">");
+        writer.write("<div class=\"v-app-loading\"></div>");
+        writer.write("</div>\n");
         writer.write("<noscript>" + getNoScriptMessage() + "</noscript>");
     }