• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 250
Python Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic