• Post Reply Bookmark Topic Watch Topic
  • New Topic

returning data to a popup jsp window

 
Mike Ottinger
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

I have a page with a simple textfield form. When a user types in a value and clicks the submit button, I want the information corresponding to this value to return in a popup jsp window. I've tried a couple of approaches and nothing seems to work, in the html with the form, I placed a javascript popup function for its onSubmit handler pointing to the page I want the content to return to. Then, on the jsp side, I use a controller servlet to handle the gathering of the data, then use it to dispatch the data to the popup page. In testing a simple string value from the bean the servlet updates, it returns null. It's pretty simple to see what happens, the popup script gets to do its work sooner than the jsp side get's to supply values to the bean this pop up jsp page uses. One tack I tried was having the popup page 'pop up' using it's own onLoad handler, well all this does is repeatedly pop the page up since every new popup has it's own onLoad to invoke. I suppose the last resort would be to have the popup jsp page read the value from the query string and build the data that way, but it would require a bit of work, I use the controller servlet in a "push", "struts" sort of way where data is in beans and the actual jsp pages simply make getProperty calls off these beans. Has anybody had luck in doing this? This can't be that difficult of a thing to pull off. Any help is greatly appreciated, Mike...
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use this function in pop up window
<script language="javascript">
window.opener.document.location="/webabc.jsp
window.close();
</script>
Besides this your popup window should also be a jsp page then only you will retrive data using HttpServletRequest object
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!