PDA

View Full Version : how to populate grid with java list dynamically



sayeed
27 Dec 2006, 7:25 PM
Hi guys
I wanna to know how to populate grid with a java list object dynamically.The issue is i am getting a
list object as return type for a function call.Now after getting the list i wanna to place the date in the
list in to the grid.Since the it is difficult to create a variable data from the list of this type dynamically
var data ={'Users':[ {'UserId': '323', 'Name':'Samba Siva Rao','Company':'PrapanSol','Login':'skolusu','Password':'welcome123','designation':'Developer'}}]

So plz suggest me the way to solve the problem.

sayeed
28 Dec 2006, 4:16 AM
Hi guys
Finally i got the logic for placing the list in the grid.Here the thing is we need to create a JSON object using the values in the list and later passing the object to javascript .At javascript create datamodel from the json object.

This is the way to place the java list in to the grid.

TommyMaintz
28 Dec 2006, 4:19 PM
Hey,

yeah, basically for every language out their there are several classes to convert an object to the JSON notation. once you have them in JSON you can easily import them with Crockfords JSON parser (wich is included in YUI-ext although slightly improved) into your javascript. then you can convert the objects to anything you want.

in the case of a grid Jack has already done the object extracting for you.