• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting parameters from a pop-up window

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is all client-side activity. Moving to the HTML/Javascript forum.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
sailaja parepalli
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks much for the reply.
 
sailaja parepalli
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Bear edit: personal message removed. Please do not use the forums for personal messages.]
[ January 25, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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 ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have face the Same problem with pop up's
 
reply
    Bookmark Topic Watch Topic
  • New Topic