• 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
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

JavaScript Objects to set array of request parameters

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am going to display below results in the JSP page. I have a Wizard kind of a flow, where user can go back & forth by clicking on the different Tabs provided (Edit, Search, Review, Finish). I can�t use sessions in my application.

First column: a check box
Second column: Client Number
Third column:Cleint Name
Fourth column: Portfolio
Fifth column: Drop Down
Six column: Radio Button

I need to save all the selections made into the JavaScript Object and pass through it back & forth. I don�t know how to use it.
Can any of you please provide any information on how I set all the request values to the Java Script Objects? Any code samples or any help is greatly appreciated.
 
Sheriff
Posts: 67762
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

Originally posted by Sara Smith:
I can�t use sessions in my application.



Let me guess. You've got some idiot CTO or project leader that told you not to use sessions regardless of when they are the right tool for the job?

Any JavaScript objects will be lost going from page to page. If you "can't" use the session, you'll need to pass them as request parameters to each page.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can't use sessions, you could keep all the needed stuff in the request, by using hidden parameters. Get the needed values from the submitted form, then put them in hidden tags.

I'm also curious about why you can't use sessions, as the above method works, but maintainability is close from 0%
 
Sara Smith
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Reason we don�t want to use session because our application will be running on multiple servers & we don�t have session persistent mechanism. Users request can be served from any of these servers & how can we handle session persistent data? In this scenario can I still make use of sessions?

My application will be are part of an inner frame, outer frame being the parent frame. Outer frame will not be refreshed; inner frame is where my application will live. Can�t I use a JavaScript Objects in the outer frame to save my request data and pass it on the request values?

In the given scenario which is the better approach using session or Java Script? I can use the Hidden parameters, but they will be lot of data manipulations back & forth. That will be my last option to go with.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As long as the outer frame is not being refreshed you can use it to cache data on the client.

window.parent.VAR_NAME will give you access to variables in the frameset (or parent page if you're using iframes).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic