• 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

Rending problem

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

I have a question about rending data from server.
My java Response class will store some data object in session, and load into combo box. Meanwhile, I have another set of data retrieved from server, and stored into session. My wish is to dynamically change the value in a table, so that it will vary according to the input by the combo box from the client side.

Here is my example:

1. Combo Box has some currency value, like AUD, CAD, EUR, etc
2. My session Stores a floating Rate option object(String pair), like
AUD-BBR-BBSW, CAD-BA-CDOR.
3. If I choose AUD from combo box, then the table should render the
innerHTML "AUD-BBR-BBSW"

However, I am not sure how to render this server side object from client side, is there any suggestions ?


THanks for helping me

Transistor
 
Ranch Hand
Posts: 93
Mac Objective C Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is very easy to do using Ajax, using--for example--the Prototype framework of Script.aculo.us.

In a nutshell, I would set up a servlet to return whatever data is required for the table, based upon the user's combo-box selection, then use Ajax.Updater (from script.aculo.us) to get the data from the servlet and populate the table when the combo-box's onchange event fired.

This would provide the user with a dynamic application.

(Obviously, Ajax has nothing to do with JSP, per se)

Note: it is not good to store data in the Session that you could retrieve from a data store easily, because it limits the scalability of your application. Too many users = server runs out of memory
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic