function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sam1980Sam1980 

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.