We have a somewhat similar situation, where we want a lot of text fields
to be updated when the user changes some value. To download all data to
the client was in our case never an option, since the number of records
are "unlimited".
My thoughts on your alternatives:
> I considered the following options :
> 1. Bring all the data to the client side and store them in hidden
combos or
> put them in a javascript array and manipulate the same.
I would not recommend this one. If you have 5000+ records and response
time I crucial, avoid downloading it all to the client. I could guess
that if the table keeps growing you can even get performance problems on
the JavaScript part.
> 2. Bring all the data from the server into a vector on the server side
and
> manipulate from there.
I don't think I understand this one. Do you mean to reload but not read
from the database but from a vector (in session/application scope)?
> 3. Hit the database on the change event of each combo ( I don't like
the
> thought of this )
This can mean two things:
1) Reload the page and get the values on any combo box change
(onChange). I understand if you don't like the thought of this.
2) Have an applet do it. This is the solution we have chosen. When the
use changes the "key"- value, an applet connects to the server which
retrieves the record from the database. Then the applet updates the
fields and combos. You could do this using a socket connection but we
chose to have it all JSP. So the applet connects to JSP which delivers
the record(s) in XML format. The applet parses the XML with NanoXML
(http://nanoxml.sourceforge.net) and updates the page. Works very neat
for us (at least in the dev environment...)
Mail me if you want more info on this or maybe try a demo page.
> 4. replicate the table into a XML document and parse from there each
time.
If you mean to parse this XML from (an applet on) the client side, this
is even worse than the first alternative. Besides XML probably gives you
more overhead (tag names) than "hidden" JavaScript, you would have to
parse that 5000+ record XML on the client AND THEN, on the client side,
find the data you are looking for.
Mattias Jiderhamn
Expert Systems
[EMAIL PROTECTED]
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets