+ Start a Discussion
Sree SalesforceSree Salesforce 

Lightning Issue: I have given attribute like this <aura:attribute name="lstPositions" type="DynamicAccountController.AccountWrapper[]" />

Am I  create list on  The attribute Like that
I am getting this error.
User-added image

When i  hide the attrbute on component. This alert is not showing.
Class:

public class DynamicAccountController {
@AuraEnabled
public static List<DynamicAccountController.AccountWrapper> GetAccountNames()
{
    List<DynamicAccountController.AccountWrapper> accountlist =new List<DynamicAccountController.AccountWrapper>();
    system.debug('--enter--');
    list<account> lstPositions=[select id,name from account limit 10];
    for(account ac:lstPositions)
    {
         
        accountlist.add(new AccountWrapper(ac));
        
    }
    system.debug('--accountlist'+accountlist);
    return accountlist;
}
    public class AccountWrapper{
        @AuraEnabled public account acc{get;set;}
        @AuraEnabled public boolean selected{get;set;}
        
        public AccountWrapper(account accs){
            acc=accs;
            selected=false;
          }
    }}