You need to sign in to do that
Don't have an account?

Reg: Wrapper Classes in Apex Programming.
Hi,
I am very new to salesforce. I Observed most of the application are designed by wrapper classes in my Organization.
Can you please share some real time code samples regarding to wrapper class.
Please tell me where we use wrapper class exactly?
It helps to understand wrapper classes easily. Your help will be greatly helps to me.
Thanks
ANKITA
A small but indeed a very helpful link by salesforce :
http://wiki.developerforce.com/index.php/Wrapper_Class
Thanks
Ankit Arora
Blog | Facebook | Blog Page
All Answers
Hi Ankita,
Wrapper class is some kind of Apex Class Object Type. There are situations when we need to create a list of items which are of various type.
In Apex List can only contain a single type of items like List<Account> , List<Contact> , if I want to have both items then I would create a wrapper class like
Basic Structure
Example : When ever you want to show a check box in a table of any list of items you will require wrapper class, like in this example we will show some record on page 1 and user will select some and will click on nextpage button and on page2 we will show only selected records
Apex Class :
Page1
Page 2
I hope above example will help you.
A small but indeed a very helpful link by salesforce :
http://wiki.developerforce.com/index.php/Wrapper_Class
Thanks
Ankit Arora
Blog | Facebook | Blog Page
Its too good!
Thanku so much.
Hi,
I am very thankful to both SHASHI and ANKIT.
I worked on these samples very well. It works fine.
Could you please share some more real time samples.
It helps to all the newly entered people and me.
Thanks,
ANKITA
Shashi, how would you write a test class for your demoClass1 example? I'm having a hard time writing a test class for my wrapper class based on the example Ankit provided and seeing a test example for you demo would be very helpful.
Thanks!
Just follow these steps
http://forceschool.blogspot.com/2011/06/testing-apex-structure-of-test-class.html
let me knoww if any issues in it.
Hi,
How to use radio buttons instead of checkboxes using Wrapper classes??
Thanks and Regards,
Devendra S
some events u mentioned in the code are for what purpose..like event in command button and one more event in <Apex:form> component