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
Amit_TrivediAmit_Trivedi 

How to display each element of array on single visualforce page

Hi,

I have arrayList and i want to display each element of list on different visualforce page.

For e.g accList[0] on one page and on click of next button accList[1] on another page and so on till the list get finish and also i want to implement previous button fuctionality.Like in below imageUser-added image
 
Sagar PareekSagar Pareek
Take a counter variable and on click of the button increase with +1 and try to access the list on the page .Make sure you render page every time user clicks on next button. 

I am not posting whole code , but this will help you to get idea.
 
public Integer counter {get;set;} //declaring the variable 

counter=0; // set this in the constructor

public void increaseCount(){ // bind this with your next button

 counter= counter+1; 

}


<!--- on your visualforce page use --->

{!accList[counter].field_to_display__c}

 
Amit_TrivediAmit_Trivedi
Thanx but can u please explain me in detail.