Author: woonsan
Date: Mon Dec 14 16:13:10 2009
New Revision: 890392
URL: http://svn.apache.org/viewvc?rev=890392&view=rev
Log:
JS2-1084: portlet window addition from the client-side script without page
refresh.
Modified:
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
Modified:
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
URL:
http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp?rev=890392&r1=890391&r2=890392&view=diff
==============================================================================
---
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
(original)
+++
portals/jetspeed-2/applications/j2-admin/trunk/src/main/webapp/WEB-INF/view/toolbox/toolbox.jsp
Mon Dec 14 16:13:10 2009
@@ -33,12 +33,9 @@
<c_rt:set var="requestContext"
value="<%=request.getAttribute(RequestContext.REQUEST_PORTALENV)%>"/>
<c:set var="portalContextPrefix"
value="${requestContext.request.contextPath}"/>
<c:set var="portalContextPath" value="${requestContext.request.contextPath}"/>
-<c:set var="portalPath" value="${requestContext.portalURL.path}"/>
-<c:if test="${empty portalContextPath}">
- <c:set var="portalContextPath" value="/"/>
-</c:if>
-<c:if test="${empty portalPath}">
- <c:set var="portalPath" value="/"/>
+<c:set var="portalPagePath" value="${requestContext.portalURL.path}"/>
+<c:if test="${empty portalPagePath}">
+ <c:set var="portalPagePath" value="/"/>
</c:if>
<table style="border-collapse: collapse; width: 100%; margin-top: 0px;
margin-bottom: 0px; float: left;">
@@ -173,7 +170,7 @@
</table>
<script language="javascript">
-YUI().use('io', 'json', 'node-base', 'cookie', function(Y) {
+YUI().use('io', 'json', 'node-base', 'cookie', 'jetui-portal', function(Y) {
function switchTab(e) {
var tabId = null;
@@ -311,8 +308,12 @@
return;
}
- //TODO: update page without refreshing.
- location.href = location.href;
+ if (JETUI_YUI && JETUI_YUI.portalInstance) {
+ var portal = JETUI_YUI.portalInstance;
+ portal.addPortlet(dataOut);
+ } else {
+ location.href = location.href;
+ }
};
var addPortlet = function(e) {
@@ -324,7 +325,7 @@
var config = {
on: { complete: onAddPortletComplete },
method: "POST",
- headers: { "X-Portal-Path" : "${portalPath}" }
+ headers: { "X-Portal-Path" : "${portalPagePath}" }
};
var request = Y.io(uri, config);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]