Wrapper class and Pagination in Salesforce

This is most commonly used concept in apex.

What is the need for wrapper class?

It is Inner class which consist of various different properties. For example, if you want to have single container which holds various types of variables or Sobject or Collection.

Second Example, Let’s say we want to showcase different opportunity along with Radio button or Checkbox and then by selecting those specific records you want to execute some logic on to this records.

For example we have list of opportunities along with checkbox,

Demo Site available here.


Apex Class

Visualforce Page: