Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript DataStructures

 
Pawanpreet Singh
Ranch Hand
Posts: 264
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 264
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 264
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic