aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to populate values in window Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to populate values in window" Watch "How to populate values in window" New topic
Author

How to populate values in window

kanthi kiran
Greenhorn

Joined: Apr 04, 2008
Posts: 12
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???
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

That's mostly stuff that needs to happen on the server. What are you using there? Java? PHP? ColdFusion?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
kanthi kiran
Greenhorn

Joined: Apr 04, 2008
Posts: 12
I am using Java on the server side.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

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

Joined: Apr 04, 2008
Posts: 12
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).
Kiran Joshi
Ranch Hand

Joined: Sep 04, 2005
Posts: 54
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
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

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

Joined: Apr 04, 2008
Posts: 12
Thanks for the suggestion Kiran Joshi.

and

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

Kanthi Kiran
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to populate values in window