• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to populate values in window

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I am Having a search(text) box and button. if we press the button a window should be open.(window.open()). but my requirement is....

(1)i have a map in session already so that when i press this button all the users available in the map should be populated in the newly opened window and

(2)when we selected that user then user name should be displayed on the text box.

how to populate session map values in newly opened window and after the selection of the user his name should be displayed on the text box.

Can any body give me some idea???
 
Sheriff
Posts: 67637
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
That's mostly stuff that needs to happen on the server. What are you using there? Java? PHP? ColdFusion?
 
kanthi kiran
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Java on the server side.
 
Bear Bibeault
Sheriff
Posts: 67637
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
OK, so what part are you having problems with?

If the information is already in the session, it's available to the controller and the JSP that will be placed in the new window.
 
kanthi kiran
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does Java Script have a capability of populating the sessionMap Values? I mean in java script function can we access sessionMap values??? Here i am trying to open a new window using JavaScript method.(window.open).
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are trying to implement a pick list kind of thing..
So in the second page, you want to present a list of users , when a particular user is selected, his name should appear in the opener screen.

If this is what you want, then for second page, just treat it as a normal jsp page & retrieve the list of users from session using JSP elements only.
Best way would be EL. render the user names as hyper links, on click on them, execute a javascript function that will update the opener form field with the selected value.

you can use window.opener.<<formid>>.<<elementid>>.value= <<selected value>>
 
Bear Bibeault
Sheriff
Posts: 67637
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

kanthi kiran wrote:Does Java Script have a capability of populating the sessionMap Values?

No.

I mean in java script function can we access sessionMap values?

No.

Here i am trying to open a new window using JavaScript method.(window.open).

Again, you'll need to deal with the session in the servlet controller and JSP for the new page.

Perhaps this article on how JSP works might help.
 
kanthi kiran
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the suggestion Kiran Joshi.

and

Thanks Bear Bibeault for clearing my doubt. and the link was nice.

Kanthi Kiran
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic