Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How session Info is sent to JavaScript (Client) here?

 
Mishra Anshu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!!
I have written a page which consists of two Frames(HTML).
I want to arrange the info. in left frame as shown below:-
-Company1
+ About Us
+ Help
-Users
+ prefix
+ Services
+ User Info
+Company2
+Company3
So, whenever a "+" is clicked in the left frame it changes into "-" and the subtree is produced below it. I have done this as far as th things are static (like "About Us", "Help") using JavaScript.
But, Now I want to get the Users list. So, It is expected to get the data from server and then to reflect this change(i.e....the list of users as sent
by the server) in this frame just below the Users.

Also, if possible tell me if how could it be acgeived if somebody wants that
in every new login all the expanded tree be shown at is was during the previous session.
Thanks for ur's suggestion
 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mishra Anshu:

But, Now I want to get the Users list. So, It is expected to get the data from server and then to reflect this change(i.e....the list of users as sent
by the server) in this frame just below the Users.

Well I can suggest generating this complete Javascript dynamically using a JSP or a bean that returns this "script" as string. The User information is indeed a server side job, and this information must be readily available to the client-side script. So when a user clicks on "+" he sees the expanded user list as if the data was fetched then and there. Actually the information would already be there on the client side script, fetched by your JSP/Servlet and made available inside script variables.
Tell me if it helped
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want the tree to be the way they left, you are going to need to use a cookie to remember the state that it was when the user left or store information in a database.
Eric
 
Mishra Anshu
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to both of You!!!
So, Should I use the session variable inside my client side javascript to
remember it the state where it left.
Can u plz. provide any such link.
Thanks again!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic