You need to sign in to do that
Don't have an account?
vishal yadav 86
Can someone explain me what the code does ?
public class Acc_Dynamic
{
Public List<AccAll> acl{set;get;}
Public Acc_Dynamic()
{
acl=new List<AccAll>();
for(Integer i=0;i<10;i++)
{
Account acc=new Account();
acl.add(new AccAll(acc,false));
}
}
public class AccAll
{
Public Account accs{set;get;}
Public Boolean flag{set;get;}
public AccAll(Account acs,Boolean flg)
{
accs=acs;
flag=flg;
}
}
}
{
Public List<AccAll> acl{set;get;}
Public Acc_Dynamic()
{
acl=new List<AccAll>();
for(Integer i=0;i<10;i++)
{
Account acc=new Account();
acl.add(new AccAll(acc,false));
}
}
public class AccAll
{
Public Account accs{set;get;}
Public Boolean flag{set;get;}
public AccAll(Account acs,Boolean flg)
{
accs=acs;
flag=flg;
}
}
}
Here AccAll is a wrapper class.A wrapper or container class is a class, a data structure, or an abstract data type which contains different objects or collection of objects as its members.
Here this wrapper is used to make a list which has both account and boolean value in each element.
Whenever this class is invoked the constructor creates a list of type AccAll
Finally a list of 10 elements with each element containing empty account and boolean value as false is created
Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.
Thanks and Regards
All Answers
Here AccAll is a wrapper class.A wrapper or container class is a class, a data structure, or an abstract data type which contains different objects or collection of objects as its members.
Here this wrapper is used to make a list which has both account and boolean value in each element.
Whenever this class is invoked the constructor creates a list of type AccAll
Finally a list of 10 elements with each element containing empty account and boolean value as false is created
Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.
Thanks and Regards
I need to insert 10 records through visualforce page only if the ckeckbox value is selected.
Now how to achieve the above functionality.
Could you please brief me on this.