+ Start a Discussion

Display Large Json Data on Visual force page

I have JSon feed at http://tinyurl.com/mpnb2fo

Want to diplay data in VF page with paging.. what is the best way to do ?

I have tried to hard code the data, in my Apex code, is there any another way to read JSON data? But if we didn't provide hard coded data then how apex class can read JSON data? How we can send JSON data to apex class?

Please help
Ruwantha  LankathilakaRuwantha Lankathilaka
First create a wrapper class for your unit of element. I will a create a wrapper class name with WrapperClass and add first 2 variables of yours.( Add all variables later)
public class WrapperClass {
    public string id {get;set;}
    public string name {get;set;}
You have 1565 records in your json. You can deserialize them as follows.
String myjson = '' //Your json here
list<WrapperClass> wrappers = new list<WrapperClass>();
wrappers = (list<WrapperClass>) System.JSON.deserialize(myjson, list<WrapperClass>.class);
Now you have list of objects of your large json.