+ Start a Discussion
sf ostsf ost 

Add Response to the currest list and show in VF page

Hi all,

I am getting a response from REST Api consisting of names and "nextpagetoken". I dont want to store this response in salesforce. Am adding these names to the WrapperList and displying them on visualforce page. I limited my callout to query only 10 names. When clicked on GetMore commandButton (making 2nd callout using nextpagetoken) i need to add the next 10 names to the existing WrapperList and show total 20 names on VF page.

Suggestions are appretiated. Thanks.
Scott Haleo 4Scott Haleo 4
Hi,

You can use Pagination with a List Controller in visualforce page and store the response in another list and on next api call add the existing records to list.

Thanks.

Scott Haleo
Hytechpro
sf ostsf ost
Can you provide me  a sample code..  It will be more useful for me.
Scott Haleo 4Scott Haleo 4
Hi,

You can check this below link for sample code & it will help you.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_sosc_pagination.htm

Best Regards,
Scott Haleo
@Hytechpro.com