summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSidharth Singh2013-08-01 10:00:05 (EDT)
committerStephan Born2013-09-23 04:57:22 (EDT)
commit5aed0c9b90a376a326cc74aa3dc695fe8b24eb9d (patch)
tree80e1286ba766475ffcd6b46a5973ed8ef5c8c9df
parentd70c3fd2ec96b86d5f0806f5ce5a687e38555346 (diff)
downloadorg.eclipse.stardust.ui.web-5aed0c9b90a376a326cc74aa3dc695fe8b24eb9d.zip
org.eclipse.stardust.ui.web-5aed0c9b90a376a326cc74aa3dc695fe8b24eb9d.tar.gz
org.eclipse.stardust.ui.web-5aed0c9b90a376a326cc74aa3dc695fe8b24eb9d.tar.bz2
Jira-ID: CRNT-29719
Registered PERSPECTIVE_CHANGED javascript event handler in PerspectiveMenuIframeHandler constructor On perspective Iframe close , published PERSPECTIVE_CHANGED event to close the Iframe. Removed the call to renderSession from PortalUiController.perspectiveChangeActionListener() git-svn-id: https://svn.csa.sungard.com/repos/ipp2/product/trunk/stardust/ui.web@66432 8100b5e0-4d52-466c-ae9c-bdeccbdeaf6b Signed-off-by: Sidharth Singh <sidharth.singh@sungard.com>
-rw-r--r--portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PerspectiveMenuIframeHandler.java9
-rw-r--r--portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PortalUiController.java9
-rw-r--r--portal-common/src/main/resources/META-INF/xhtml/perspectiveMenuIframePopup.xhtml29
3 files changed, 33 insertions, 14 deletions
diff --git a/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PerspectiveMenuIframeHandler.java b/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PerspectiveMenuIframeHandler.java
index 749546b..2334686 100644
--- a/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PerspectiveMenuIframeHandler.java
+++ b/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PerspectiveMenuIframeHandler.java
@@ -24,6 +24,13 @@ public class PerspectiveMenuIframeHandler implements Serializable
private boolean open = false;
+ public PerspectiveMenuIframeHandler()
+ {
+ String script = "parent.EventHub.events.subscribe('PERSPECTIVE_CHANGED', function() {InfinityBpm.ProcessPortal.closeContentFrame("
+ + IFRAME_ID + ");});";
+ PortalApplicationEventScript.getInstance().addEventScript(script);
+ }
+
public void togglePopup()
{
if (isOpen())
@@ -48,8 +55,8 @@ public class PerspectiveMenuIframeHandler implements Serializable
JavascriptContext.addJavascriptCall(FacesContext.getCurrentInstance(), script);
PortalApplicationEventScript.getInstance().addEventScript(script);
- open = false;
}
+ open = false;
}
/**
diff --git a/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PortalUiController.java b/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PortalUiController.java
index 311ad4f..2837d29 100644
--- a/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PortalUiController.java
+++ b/portal-common/src/main/java/org/eclipse/stardust/ui/web/common/app/PortalUiController.java
@@ -32,6 +32,7 @@ import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
+import javax.faces.event.ValueChangeEvent;
import org.eclipse.stardust.ui.web.common.IPerspectiveDefinition;
import org.eclipse.stardust.ui.web.common.LaunchPanel;
@@ -403,9 +404,9 @@ public class PortalUiController
* @param ae
* @throws AbortProcessingException
*/
- public void perspectiveChangeActionListener(ActionEvent ae) throws AbortProcessingException
+ public void perspectiveChangeActionListener(ValueChangeEvent ae) throws AbortProcessingException
{
- String perspectiveId = FacesUtils.getRequestParameter("perspectiveId");
+ String perspectiveId = (String)ae.getNewValue();
processPerspectiveChange(perspectiveId);
}
@@ -425,15 +426,15 @@ public class PortalUiController
{
setPerspective(perspective);
- if (portalApplication.isPinViewOpened() && null != portalApplication.getPinView())
+ if (portalApplication.isPinViewOpened() && null != portalApplication.getPinView())
{
broadcastNonVetoableViewEvent(portalApplication.getPinView(), ViewEventType.PERSPECTIVE_CHANGED);
}
break;
}
}
- portalApplication.renderPortalSession();
perspectiveMenuIframeHandler.closeIframePopup();
+
}
/**
diff --git a/portal-common/src/main/resources/META-INF/xhtml/perspectiveMenuIframePopup.xhtml b/portal-common/src/main/resources/META-INF/xhtml/perspectiveMenuIframePopup.xhtml
index e05159b..99fe136 100644
--- a/portal-common/src/main/resources/META-INF/xhtml/perspectiveMenuIframePopup.xhtml
+++ b/portal-common/src/main/resources/META-INF/xhtml/perspectiveMenuIframePopup.xhtml
@@ -58,25 +58,36 @@
}
}
}
+
+ function closePerspective(perspectiveId)
+ {
+ document.getElementById("perspectiveMenuPopup:perspectiveMenuCloseFlag").value = perspectiveId;
+ window.iceSubmitPartial(document.getElementById("perspectiveMenuPopup"), document
+ .getElementById("perspectiveMenuPopup:perspectiveMenuCloseFlag"));
+ window.setTimeout(function() {parent.EventHub.events.publish("PERSPECTIVE_CHANGED");parent.BridgeUtils.View.syncLaunchPanels();},200);
+ }
</script>
</head>
<body style="width: 100%; height: 100%;"
onLoad="if(windowLoaded){windowLoaded()}">
- <ice:form>
+ <ice:form id="perspectiveMenuPopup">
<ice:panelGroup>
<ice:panelGrid columns="1" style="white-space: nowrap;vertical-align: top;border:none;" cellspacing="0" cellpadding="0" styleClass="topMenu">
<c:forEach items="#{ippPortalUi.perspectiveItems}" var="perspective">
<ice:panelGroup styleClass="iceMnuItm" style="border-top: none; border-bottom: 1px solid #666666;">
- <ice:commandLink
- actionListener="#{ippPortalUi.perspectiveChangeActionListener}" immediate="true" title="#{perspective.title}">
- <f:param name="perspectiveId" value="#{perspective.id}" />
- <ice:panelGroup style="padding-left:20px;padding-right:10px;">
- <ice:outputText value="#{perspective.value}"/>
- </ice:panelGroup>
- </ice:commandLink>
- </ice:panelGroup>
+ <ice:commandLink title="#{perspective.title}"
+ onclick="closePerspective('#{perspective.id}');">
+ <f:param name="perspectiveId" value="#{perspective.id}" />
+ <ice:panelGroup style="padding-left:20px;padding-right:10px;">
+ <ice:outputText value="#{perspective.value}" />
+ </ice:panelGroup>
+ </ice:commandLink>
+ </ice:panelGroup>
</c:forEach>
+ <ice:inputHidden id="perspectiveMenuCloseFlag" value=""
+ valueChangeListener="#{ippPortalUi.perspectiveChangeActionListener}"
+ partialSubmit="true" immediate="true" />
</ice:panelGrid>
</ice:panelGroup>
</ice:form>