eg. suppose i have a object and want to show all record on page so i will get all record into a list and to show this list on page by pageblocktable and i need to show a another variable value with each record which are not related to this object and dont have any relationship but show status for that record is selected or not. We know we can bind a single variable pageblock table so for this we make a wrapper class. This wrapper class contain the instance of the object and value of extra variable which is using along with each record and make a list of intance of this wrapper class and we will bind this wrapper class instance with page block table.
It is not necessary to use a wrapper class everytime you create a custom controller.
For more details regarding wrapper classes, read the wrapper class post on wiki.
http://wiki.developerforce.com/page/Wrapper_Class
Wrapper classes are used to bind different datatype's together.
A pageblock table with checkboxes is an example.
Hi ,
Good question.
I am giving you a small examle.
eg. suppose i have a object and want to show all record on page so i will get all record into a list and to show this list on page by pageblocktable and i need to show a another variable value with each record which are not related to this object and dont have any relationship but show status for that record is selected or not. We know we can bind a single variable pageblock table so for this we make a wrapper class. This wrapper class contain the instance of the object and value of extra variable which is using along with each record and make a list of intance of this wrapper class and we will bind this wrapper class instance with page block table.
thank
Wrapper classes are also used when you want to write your own methods on SObjects