aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Getting parameters from a pop-up window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Getting parameters from a pop-up window" Watch "Getting parameters from a pop-up window" New topic
Author

Getting parameters from a pop-up window

sailaja parepalli
Ranch Hand

Joined: Jan 23, 2003
Posts: 33
Hi all,
Does anybody know how to work with pop-up windows in a jsp?

I could display a pop-up window by sending a value from the parent jsp as the request parameter. The jsp in the pop-up window takes this parameter and displays a set of values on the window depending on the parameter value. The user should select a value from these set of values.

Now I need to send the selected value back to the parent window as soon as I select a value in the pop up window. This pop up window also should get closed immediately.

I appreciate if anybody can tell me how to achieve this.

Thanks.
[ April 13, 2007: Message edited by: Bear Bibeault ]

Sailu<br />IBM 486, SCJP, Brainbench CJP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61201
    
  66

This is all client-side activity. Moving to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61201
    
  66

Now I need to send the selected value back to the parent window as soon as I select a value in the pop up window.


Your Javascript handler can reference the main page via the opener variable, which you can use to trigger any changes in the parent page.
rahul V kumar
Ranch Hand

Joined: May 20, 2003
Posts: 82
sailaja parepalli
Ranch Hand

Joined: Jan 23, 2003
Posts: 33
Thanks much for the reply.
sailaja parepalli
Ranch Hand

Joined: Jan 23, 2003
Posts: 33
Thanks for your reply too Rahul.

I could send a value back from the pop-up window.

Do you know how to send the user authentication information to the new window without embedding the password in the url?

Thanks again.
Dharmanand Singh
Greenhorn

Joined: Oct 27, 2004
Posts: 13
Originally posted by sailaja parepalli:
Hi all,
Does anybody know how to work with pop-up windows in a jsp?
...
Thanks.


On the pop up page, include a javascript function which will be called on submitting the pop up box. Now you can populate the fields of the parent window or populate the value of any hidden field on the parent window by the javascript statement:
window.opener.document.<object_name (or form_name)>.value = <value_on_pop_up_page>;

Basically, window.opener.document will give you the document object of the parent page, and then you can play on further.
[ November 18, 2004: Message edited by: Dharmanand Singh ]
suresh india
Greenhorn

Joined: Jan 25, 2007
Posts: 1
[Bear edit: personal message removed. Please do not use the forums for personal messages.]
[ January 25, 2007: Message edited by: Bear Bibeault ]

-----------------------------<br />Suresh Parepalli - India<br />sureshkumarmbaindia@gmail.com
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61201
    
  66

"suresh india"

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Since you have revealed that your real name is Suresh Parepall, that is the display name that you must use.

Thanks!
bear
JavaRanch Sheriff
[ January 25, 2007: Message edited by: Bear Bibeault ]
Suhas Lonarkar
Greenhorn

Joined: Apr 13, 2007
Posts: 1
I have face the Same problem with pop up's
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting parameters from a pop-up window