wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes JavaScript DataStructures Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JavaScript DataStructures" Watch "JavaScript DataStructures" New topic
Author

JavaScript DataStructures

Pawanpreet Singh
Ranch Hand

Joined: Jun 12, 2005
Posts: 264

Hi All,
Suppose i have 5 rows in table (oracle database). I have fetched those records using some java objects (java.sql.ResultSet. Now i want that whole result set on client end. So i can store into JavaScript Data Structure (Array). I had everything at client end.Suppose i have changed the 2 rows out of 5 rows and want to update those update ones at server by sending an Http request to server that update rows and send a fresh copy of all rows.........................Is it possible.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Is it possible?

Yes it will take some work. This is what you could do rather easily. Build a table with your serverside code. Set the rows you do not want to show to hidden with style="display:none" to show it you would change the property to block.

For the request that gets tricky. You could use AJAX to avoid submitting a form.

Eric
Pawanpreet Singh
Ranch Hand

Joined: Jun 12, 2005
Posts: 264

Thanks Eric..
I want just to submit a JAVASCRIPT OBJECT (DATASTRUCTURE) to HTTP server after doing changes in 5 rows.

My requirement is that suppose i have two buttons, SAVE and SUBMIT. On press on SAVE, data will be updated in some JAVASCRIPT DATA Structure and finally on pressing SUBMIT. it should send that whole javascript to HTTP Server. Is it possible. Please give me some suggestion. I think it is not possible to send a Java script object to HTTP Server. We can only send data to server by query string or submitting the form. And form will only submit whatever contained in form elements not of javascript. IS IT POSSIBLE ?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You would need to format the data to send to the server. You either can put the whole thing into a textarea or multiple text boxes and submit it. As you said you can not just send an JS object to the server.

Eric
Pawanpreet Singh
Ranch Hand

Joined: Jun 12, 2005
Posts: 264

Thanks a lot Eric..

Yes i do agree with your suggestion. Does AJAX provides this work also. or we will have to use textarea like formattig and submit form...

Thanks again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaScript DataStructures