]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixes #5912 - Portlet no longer generates div with duplicate id
authorJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Tue, 18 Jan 2011 10:59:40 +0000 (10:59 +0000)
committerJonatan Kronqvist <jonatan.kronqvist@itmill.com>
Tue, 18 Jan 2011 10:59:40 +0000 (10:59 +0000)
svn changeset:16920/svn branch:6.5

src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java

index 92d2ede583553cb1808e3d803bedacf56baa9f83..8e586f5ee5f669d57e34b4e03829a5e1f1d98777 100644 (file)
@@ -805,7 +805,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
         Application newApplication = getNewApplication(request);
         final PortletApplicationContext2 context = PortletApplicationContext2
                 .getApplicationContext(request.getPortletSession());
-        context.addApplication(newApplication, request.getWindowID());
+        context.addApplication(newApplication, getDecoratedWindowID(request));
         return newApplication;
     }
 
@@ -822,8 +822,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
 
         PortletApplicationContext2 context = PortletApplicationContext2
                 .getApplicationContext(session);
-        Application application = context.getApplicationForWindowId(request
-                .getWindowID());
+        Application application = context
+                .getApplicationForWindowId(getDecoratedWindowID(request));
         if (application == null) {
             return null;
         }
@@ -936,11 +936,15 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
         }
 
         writeAjaxPageHtmlMainDiv(request, response, page,
-                request.getWindowID(), classNames, divStyle);
+                getDecoratedWindowID(request), classNames, divStyle);
 
         page.close();
     }
 
+    private String getDecoratedWindowID(PortletRequest request) {
+        return "v-" + request.getWindowID();
+    }
+
     /**
      * This method writes the scripts to load the widgetset and the themes as
      * well as define Vaadin configuration parameters on the HTML fragment that
@@ -1132,8 +1136,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet
             RenderResponse response, final BufferedWriter writer,
             Map<String, String> config) throws IOException, PortletException {
 
-        writer.write("vaadin.vaadinConfigurations[\"" + request.getWindowID()
-                + "\"] = {");
+        writer.write("vaadin.vaadinConfigurations[\""
+                + getDecoratedWindowID(request) + "\"] = {");
 
         Iterator<String> keyIt = config.keySet().iterator();
         while (keyIt.hasNext()) {