This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing the values from popup window to jsp

 
Swathi Prakash
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to get the value from popup window to jsp page . i am uaing html:link in popup window. if i click the link the value should me displayed in the jsp page. in the same time , the popup window should be closed.how can i do this? please help me.



Thanks in Advance

Swathi
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can set data for display into session scope.
 
Junilu Lacar
Bartender
Pie
Posts: 7268
44
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most implementations I have seen do this via JavaScript. For examples, see the "Pop-up Picker" example here

Setting data in the session is something I would not recommend doing in this situation. You'd have to submit the data in the popup window, then force the parent window to refresh itself. Not pretty.
 
Liz Brown
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I have a jsp page(jsp1) with 4 text fields and 3 buttons at bottom.

3 of the text fields have images next to them.
For example: for 1 text field, when user clicks on that image next to it(in jsp1), a jsp page(jsp2) pops up with some information. User clicks on the name from the list by selecting radio button there and presses 'select' on that pop up jsp2 page. After select is pressed the name chosen is to be displayed in the text box of jsp1. Any idea how to do this?
 
Junilu Lacar
Bartender
Pie
Posts: 7268
44
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Liz Brown:
Any idea how to do this?


I always cringe a little when I see statements like "a JSP page pops up". You have get it clear in your mind that a JSP is really just a convenient way of writing a servlet. As such, a JSP page never pops up because a servlet doesn't pop up. Servlets and JSPs are server-side components. A popup window is a client side entity. Ne'er the twain meet. I prefer to say you "bring up a JSP in a popup window" or to be more technically correct, you "bring up the results of invoking a JSP in a popup window" but that's a little too wordy.

At any rate, the solution to your problem would be the same as the one I pointed out above.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic