074_Wrapper_Class

https://developer.salesforce.com/page/Wrapper_Class 

http://www.sfdcpoint.com/salesforce/wrapper-class-in-apex/ 

 

Wrapper Class 模板可以归类为:

public class AccountSelectClassController{
 
    //Our collection of the class/wrapper objects wrapAccount 
    public List<wrapAccount> wrapAccountList {get; set;}

       ******
	   ******
 
    // This is our wrapper/container class. A container class is a class, a data structure, or an abstract data type whose instances are collections of other objects. In this example a wrapper class contains both the standard salesforce object Account and a Boolean value
    public class wrapAccount {
        public Account acc {get; set;}
        public Boolean selected {get; set;}
 
        //This is the contructor method. When we create a new wrapAccount object we pass a Account that is set to the acc property. We also set the selected value to false
        public wrapAccount(Account a) {
            acc = a;
            selected = false;
        }
    }
}

  

posted @ 2018-10-10 08:46  BandariFang  阅读(170)  评论(0编辑  收藏  举报