Fix for AWC-1320

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6168 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2007-07-04 16:30:07 +00:00
parent 3740cfc7ff
commit 6267bfbe4a
2 changed files with 18 additions and 12 deletions

View File

@@ -85,18 +85,7 @@ public class UINodeInfo extends SelfRenderingComponent
{
ResponseWriter out = context.getResponseWriter();
// write out the JavaScript specific to the NodeInfo component,
// make sure it's only done once
Object present = context.getExternalContext().getRequestMap().
get(NODE_INFO_SCRIPTS_WRITTEN);
if (present == null)
{
out.write("<script>var AlfNodeInfoMgr = new Alfresco.PanelManager(" +
"\"NodeInfoBean.sendNodeInfo\", \"noderef\");</script>");
context.getExternalContext().getRequestMap().put(
NODE_INFO_SCRIPTS_WRITTEN, Boolean.TRUE);
}
outputNodeInfoScripts(context, out);
// wrap the child components in a <span> that has the onmouseover
// event which kicks off the request for node information
@@ -108,6 +97,20 @@ public class UINodeInfo extends SelfRenderingComponent
}
}
protected static void outputNodeInfoScripts(FacesContext context, ResponseWriter out) throws IOException
{
// write out the JavaScript specific to the NodeInfo component, ensure it's only done once
Object present = context.getExternalContext().getRequestMap().get(NODE_INFO_SCRIPTS_WRITTEN);
if (present == null)
{
out.write("<script>var AlfNodeInfoMgr = new Alfresco.PanelManager(" +
"\"NodeInfoBean.sendNodeInfo\", \"noderef\");</script>");
context.getExternalContext().getRequestMap().put(
NODE_INFO_SCRIPTS_WRITTEN, Boolean.TRUE);
}
}
@Override
public void encodeEnd(FacesContext context) throws IOException
{

View File

@@ -96,6 +96,9 @@ public class UIOpenSearch extends SelfRenderingComponent
context.getExternalContext().getRequestMap().put(SCRIPTS_WRITTEN, Boolean.TRUE);
}
// we use summary info panel pop-ups so need scripts for that object
UINodeInfo.outputNodeInfoScripts(context, out);
// write out the javascript initialisation required
out.write("<script type='text/javascript'>\n");
out.write("var ");