The popup that I have is done by the user selecting a save button that is
part of the .jsp page (not the portlet action bar). This calls the
following javascript code which popups a window for the user to enter a
note:
function addNotePopupWindow()
{
sHeight = screen.height
sWidth = screen.width
wHeight = 200 //new window height
wWidth = 400 //new window width
wLeft = (sWidth - wWidth) / 2 //left position
wTop = (sHeight - wHeight) / 2 //top position
var myBars =
'directories=no,location=no,menubar=no,status=yes,titlebar=no,toolbar=no';
var myOptions = 'scrollbars=no,resizeable=no,width=' + wWidth +
',height=' + wHeight + ',left=' + wLeft + ',top=' + wTop;
var myFeatures = myBars + ',' + myOptions;
childWin = open('','childWin',myFeatures);
childWin.document.writeln("<script language='Javascript'>");
childWin.document.writeln("function sendToParent()");
childWin.document.writeln("{");
childWin.document.writeln("var myStr = new
String(document.childForm.sendText.value);");
childWin.document.writeln("if (myStr.length > 2000)");
childWin.document.writeln("{");
childWin.document.writeln("alert('Only 2000 characters are
allowed');");
childWin.document.writeln("document.childForm.sendText.value =
myStr.substr(0,2000);");
childWin.document.writeln("return;");
childWin.document.writeln("} else {");
//save the text from the popup to the parent window
childWin.document.writeln("window.opener.document.taskForm_<%=key%>.noteText
.value = document.childForm.sendText.value;");
childWin.document.writeln("window.opener.processAction_<%=key%>('doAddnote')
;");
childWin.document.writeln("window.close();");
childWin.document.writeln("}}");
childWin.document.writeln("<\/script>");
childWin.document.writeln("<form name='childForm'>");
childWin.document.writeln("<table>");
childWin.document.writeln("<tr><td>Enter a note for this
Exception:<\/td><\/tr>");
childWin.document.writeln("<tr><td><textarea name='sendText'
cols='40' rows='6' wrap='virtual' align='center'><\/textarea><\/td><\/tr>");
childWin.document.writeln("<tr><td align='center'><input
type='button' name='submit' value='Add' onclick='sendToParent()'>");
childWin.document.writeln("<input type='button' name='submit'
value='Cancel' onclick='window.close()'><\/td><\/tr>");
childWin.document.writeln("<\/table>");
childWin.document.writeln("<\/form>");
}
----------------------------------------------------
This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.com
-----Original Message-----
From: Abhijeet Solanki [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 6:19 PM
To: 'Boyd, David'
Subject: Re: Popup windows with Portlets
Hi David,
Can you please let us know how you achieved this?
Is the popup another portlet or it is part of the portlet present in the
opener page? Have you created a mode called "popup mode" like print ?
Thanks,
Abhijeet
-----Original Message-----
From: Boyd, David [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 10:40 AM
To: 'Jetspeed Users List'
Subject: RE: Popup windows with Portlets
I was able to do this. I have a icon a screen which pops up a window to
all the user to enter a note. Selects the save on the popup window, the
window sets a hidden field on the portlet and exits the popup window,
which will also at the same time call the event action to submit the
changes to the database and refresh the screen.
----------------------------------------------------
This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.com
-----Original Message-----
From: Kai Grossjohann [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2003 12:28 PM
To: [EMAIL PROTECTED]
Subject: Popup windows with Portlets
"Igor, make it so that we can use popup windows with portlets!" "Yeth,
marthther."
I know that it is very difficult to make popup windows work with
portlets. But I gotta try. The powers that be expressed their
wishes...
So is there any way at all for a popup window to communicate with the
portlet? I will need bidirectional communication.
If it soothes you at all, I'll try to make it so that the popup behaves
like a modal dialog, eg by telling the porlet to give focus to the popup
if there is a popup, using JavaScript.
The idea goes like this: user clicks on icon to frob the search range.
The window does what windows aren't allowed to do in portal sites and
shows two input fields to the user, start date and end date. User frobs
these two items, clicks okay. The window disappears, and now the
portlet session knows the new start/end dates.
Hm. In principle, one could imagine having two portlets, the search
form portlet and the search range portlet. The latter is normally
minimized. But if the user clicks on a special button in the search
form portlet, the search range portlet is maximized (or restored, or
something), allowing the user to enter the date. After the user clicks
submit, the search range portlet is minimized again, going back to the
previous view. The new search range is remembered in the portlet
session.
Would this work?
I'd be happy about any suggestions you might have.
Kai
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]