diff options
author | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-01-18 12:05:32 +0000 |
---|---|---|
committer | Jonatan Kronqvist <jonatan.kronqvist@itmill.com> | 2011-01-18 12:05:32 +0000 |
commit | bf15697851e95ca9fe5c20f7c304b851af7801a4 (patch) | |
tree | 131e53023cb7b5616afe77add9f5b917b153ef5e /src | |
parent | 4e1a5db861e9e73e69fd492a55f171625f255beb (diff) | |
download | vaadin-framework-bf15697851e95ca9fe5c20f7c304b851af7801a4.tar.gz vaadin-framework-bf15697851e95ca9fe5c20f7c304b851af7801a4.zip |
Cleaned up the fix for #5912
svn changeset:16923/svn branch:6.5
Diffstat (limited to 'src')
-rw-r--r-- | src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index 8e586f5ee5..4f93afff56 100644 --- a/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -805,7 +805,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet Application newApplication = getNewApplication(request); final PortletApplicationContext2 context = PortletApplicationContext2 .getApplicationContext(request.getPortletSession()); - context.addApplication(newApplication, getDecoratedWindowID(request)); + context.addApplication(newApplication, request.getWindowID()); return newApplication; } @@ -822,8 +822,8 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet PortletApplicationContext2 context = PortletApplicationContext2 .getApplicationContext(session); - Application application = context - .getApplicationForWindowId(getDecoratedWindowID(request)); + Application application = context.getApplicationForWindowId(request + .getWindowID()); if (application == null) { return null; } @@ -936,12 +936,21 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet } writeAjaxPageHtmlMainDiv(request, response, page, - getDecoratedWindowID(request), classNames, divStyle); + getApplicationDomId(request), classNames, divStyle); page.close(); } - private String getDecoratedWindowID(PortletRequest request) { + /** + * Creates and returns a unique ID for the DIV where the application is to + * be rendered. We need to generate a unique ID because some portals already + * create a DIV with the portlet's Window ID as the DOM ID. + * + * @param request + * PortletRequest + * @return the id to use in the DOM + */ + private String getApplicationDomId(PortletRequest request) { return "v-" + request.getWindowID(); } @@ -1137,7 +1146,7 @@ public abstract class AbstractApplicationPortlet extends GenericPortlet Map<String, String> config) throws IOException, PortletException { writer.write("vaadin.vaadinConfigurations[\"" - + getDecoratedWindowID(request) + "\"] = {"); + + getApplicationDomId(request) + "\"] = {"); Iterator<String> keyIt = config.keySet().iterator(); while (keyIt.hasNext()) { |