Author: chris.laprun(a)jboss.com
Date: 2008-02-13 21:00:29 -0500 (Wed, 13 Feb 2008)
New Revision: 9964
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java
Log:
- Fixed remote control window that was still referencing /simple context.
- Use namespace for javascript functions.
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java 2008-02-14
01:28:51 UTC (rev 9963)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/portal/samples/RemoteControlResourcePortlet.java 2008-02-14
02:00:29 UTC (rev 9964)
@@ -31,9 +31,11 @@
{
renderResponse.setContentType("text/html");
PrintWriter printWriter = renderResponse.getWriter();
- printWriter.print("<script type='text/javascript'>function
openRemote(url){window.name='jbp_parent';" +
- "window.open(url, 'jbp_remote',
'width=400,height=200,scrollable=yes')}</script>");
- printWriter.print("<p><a href='#'
onclick=\"openRemote('");
+ String namespace = renderResponse.getNamespace();
+ printWriter.print("<script type='text/javascript'>function
" + namespace
+ + "_openRemote(url){window.name='" + namespace +
"_parent';window.open(url, '" + namespace
+ + "_remote',
'width=400,height=200,scrollable=yes')}</script>");
+ printWriter.print("<p><a href='#' onclick=\"" +
namespace + "_openRemote('");
ResourceURL resource = renderResponse.createResourceURL();
printWriter.print(resource);
printWriter.print("')\">Open remote
control!</a></p>");
@@ -47,19 +49,20 @@
{
resourceResponse.setContentType("text/html");
PrintWriter writer = resourceResponse.getWriter();
+ String namespace = resourceResponse.getNamespace();
// resourceRequest.getPreferences().setValue("color", COLORS[COLOR_INDEX++
% 8]);
- writer.print("<html><head><script
type='text/javascript'>function
openLinkInParent(url){window.open(url,'jbp_parent');}</script>" +
- "<link rel=\"stylesheet\"
href=\"/simple/css/master.css\"
type=\"text/css\"/></head><body>");
+ writer.print("<html><head><script
type='text/javascript'>function
openLinkInParent(url){window.open(url,'"
+ + namespace + "_parent');}</script>\n<link
rel=\"stylesheet\" href='/simple-portal/css/master.css'
type=\"text/css\"/></head><body>");
PortletURL url = resourceResponse.createRenderURL();
url.setWindowState(WindowState.MINIMIZED);
writer.print("<div
class=\"remote-container\"><ul><li><a href='#'
onclick=\"" + createParentURL(url) + "\"><img\n" +
- " src=\"/simple/images/icon-minimize.gif\"
alt=\"\"/> minimize parent portlet</a></li>");
+ "
src=\"/simple-portal/images/icon-minimize.gif\" alt=\"\"/> minimize
parent portlet</a></li>");
url.setWindowState(WindowState.MAXIMIZED);
writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\"><img\n" +
- " src=\"/simple/images/icon-maximize.gif\"
alt=\"\"/> maximize parent portlet</a></li>");
+ "
src=\"/simple-portal/images/icon-maximize.gif\" alt=\"\"/> maximize
parent portlet</a></li>");
url.setWindowState(WindowState.NORMAL);
writer.print("<li><a href='#' onclick=\"" +
createParentURL(url) + "\"><img\n" +
- " src=\"/simple/images/icon-normal.gif\"
alt=\"\"/> make parent portlet
normal</a></li></ul>");
+ "
src=\"/simple-portal/images/icon-normal.gif\" alt=\"\"/> make
parent portlet normal</a></li></ul>");
writer.print("<br/><ul><li><b>'zipcode'</b>
public render parameter value: " + resourceRequest.getParameter(ZIPCODE) +
"<br/>");
writer.print("Set value of <b>'zipcode'</b> public render
parameter to:</li>");
url.setParameter(ZIPCODE, "80201");
Show replies by date