The moose likes JSP and the fly likes how to pass resultset object as a parameter to a javascript function Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "how to pass resultset object as a parameter to a javascript function" Watch "how to pass resultset object as a parameter to a javascript function" New topic
Author

how to pass resultset object as a parameter to a javascript function

k kousalya
Greenhorn

Joined: Jun 09, 2009
Posts: 12
hai ,
I have one doubt. How to pass ResultSet object as a parameter to a java script function. Icould pass ResultSet object as a parameter. But my problem how access that object and how to get the data from that resultset and how to display that data in tabular form.
Could please any one help me.
Thanks in Advance
Andy Crane
Greenhorn

Joined: Dec 30, 2008
Posts: 17
Hello,

To me it sounds like you may want to look into a javascript library that has a built in grid.

The one I have used most often for working with sets of data on the client side is Dojo. There are a few issues with Dojo, but overall it's not too bad an experience.

Basically, you assign your resultset to a json object, which is really just a hash object, and then you can use it as a regular recordset on the client side, you can query it, change values, display it in a grid with additional options for sorting, filtering, updating the data via ajax, etc.

Please note that this is NOT an advertisement for Dojo's javascript library. My preference is Jquery, Mootools then Yui. If I never code Dojo again I'll be happy

BUT, they have a good grid implementation. http://www.dojotoolkit.org/


BTW, there is another option... Go here: javascript documentation. You will find all of the different ways of accessing objects in javascript here. There are different ways of getting the properties of the object, depending on the type of object, and the types of data in that object. At the end of the day though, an object in javascript consists of name - value pairs that contain any sort of data that javascript supports. That's the key to determining how to access your data.


- andy c

This message was edited 1 time. Last update was at by Andy Crane



- andy c
"Pseudo code first. If you can pseudo code accurately, when you start writing code, you're just applying syntax to the pseudo code. It separates the two most complicated pieces of programming into manageable bites. You create your app's workflow without worrying about syntax. Then you code without worrying about your app's workflow."
 
 
subject: how to pass resultset object as a parameter to a javascript function
 
developer file tools