aspose file tools*
The moose likes JSP and the fly likes Popup Window from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Popup Window from JSP" Watch "Popup Window from JSP" New topic
Author

Popup Window from JSP

Snehal Kamble
Greenhorn

Joined: Mar 13, 2006
Posts: 7
I have a JSP i.e. parent window with a hyperlink . On click of the hyperlink i call a javascript to call popup window .
window.open("login.do","PopUp");
The login.do struts path on success calls Popup.jsp. There is a text field on Popup.jsp the value of the text field i want on parent window in some hidden field.
How do i do that ?
I tried using opener.document.<form name>.<text field>.value
but it doesn't work.
The form on parent window is undefined.
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Welcome to JavaRanch Snehal


Originally posted by Snehal Kamble:

The form on parent window is undefined.


What do you means by this? Are you getting this error?
[ March 13, 2006: Message edited by: Chetan Parekh ]

My blood is tested +ve for Java.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Can you pass the value of the textbox as a request parameter ?
window.open("login.do?text=value","PopUp");


[My Blog]
All roads lead to JavaRanch
Chetan Parekh
Ranch Hand

Joined: Sep 16, 2004
Posts: 3636
Originally posted by Satou kurinosuke:
Can you pass the value of the textbox as a request parameter ?
window.open("login.do?text=value","PopUp");


Hey Satou,actually he needs values from child window (popup) to the parent window - not the opposite one.
Snehal Kamble
Greenhorn

Joined: Mar 13, 2006
Posts: 7
right .. i require values from popup window to parent window .
if i do alert(window.opener) on Popup.jsp it is shown as undefined.
Hence javascript in Popup.jsp
function setValue(val)
{
window.opener.document.PARENT_FORM.parentfield.value=val;
window.close();
}
doesn't work..
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

actually he needs values from child window (popup) to the parent window

oops
[ March 13, 2006: Message edited by: Satou kurinosuke ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Did you try with self.opener ?
Snehal Kamble
Greenhorn

Joined: Mar 13, 2006
Posts: 7
tried with self.opener also but doesn't help
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60082
    
  65

As this has clearly become about HTML and Javascript. moved to that forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Popup Window from JSP
 
Similar Threads
Issue in populating field in parent window
Passing Value From Popup Window To Parent Window
Popup Window from JSP
Popup window jsp page
Communicate from a Popup Window back to the Parent Window