Author: julien(a)jboss.com
Date: 2007-04-08 08:38:21 -0400 (Sun, 08 Apr 2007)
New Revision: 6954
Modified:
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
trunk/theme/src/bin/portal-ajax-war/dyna/dyna.js
Log:
there was a bug in updating portlet markup on screen, the fragment origin of the event was
updated and not what the server was targetting
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-04-08
10:31:41 UTC (rev 6953)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-04-08
12:38:21 UTC (rev 6954)
@@ -235,8 +235,6 @@
}
headerChars = fragment.getHeader();
- // Transform here the ajax stuff
-
//
List supportedWindowStates = new ArrayList();
for (Iterator i =
instance.getPortlet().getInfo().getCapabilities().getAllWindowStates().iterator();
i.hasNext();)
@@ -273,8 +271,15 @@
//
addStateActions(context, window, actionMap, windowNS.getWindowState(),
supportedWindowStates);
- //
- contentChars = fragment.getContent();
+ // Handle minimized here
+ if (WindowState.MINIMIZED == windowNS.getWindowState())
+ {
+ contentChars = "";
+ }
+ else
+ {
+ contentChars = fragment.getContent();
+ }
// Update window props after render if needed
Boolean asynchronous =
(Boolean)invocation.getAttribute(PortletInvocation.RESPONSE_PROPERTIES_SCOPE,
"asynchronous");
Modified: trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml
===================================================================
---
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-04-08
10:31:41 UTC (rev 6953)
+++
trunk/core-samples/src/resources/portal-samples-war/WEB-INF/default-object.xml 2007-04-08
12:38:21 UTC (rev 6954)
@@ -65,8 +65,8 @@
<page-name>Test</page-name>
<properties>
<property>
- <name>theme.ajax.object_enabled</name>
- <value>false</value>
+ <name>theme.dyna.async_window_enabled</name>
+ <value>true</value>
</property>
<property>
<name>order</name>
Modified: trunk/theme/src/bin/portal-ajax-war/dyna/dyna.js
===================================================================
--- trunk/theme/src/bin/portal-ajax-war/dyna/dyna.js 2007-04-08 10:31:41 UTC (rev 6953)
+++ trunk/theme/src/bin/portal-ajax-war/dyna/dyna.js 2007-04-08 12:38:21 UTC (rev 6954)
@@ -155,18 +155,25 @@
// Different than 1 is not good
if (matchingElt != null)
{
- var markup = resp.fragments[id];
- markup = markup.substring(25, markup.length - 7);
+ var dstContainer = document.getElementById(id);
+ if (dstContainer != null)
+ {
+ // Get markup fragment
+ var markup = resp.fragments[id];
+ markup = markup.substring(25, markup.length - 7);
- var markupContainer = Element.up(matchingElt);
+ // Create a temporary element and paste the innerHTML in it
+ var srcContainer = document.createElement("div");
+ srcContainer.innerHTML = markup;
- // Create a temporary element and paste the innerHTML in it
- var tmpElt = document.createElement("toto");
- tmpElt.innerHTML = markup;
-
- //
- copyInnerHTML(tmpElt, container, "dyna-portlet")
- copyInnerHTML(tmpElt, container, "dyna-handle")
+ //
+ copyInnerHTML(srcContainer, dstContainer,
"dyna-portlet")
+ copyInnerHTML(srcContainer, dstContainer,
"dyna-handle")
+ }
+ else
+ {
+ // Should log that somewhere
+ }
}
else
{