I am using a wrapper class so as not to have a glut of aura:attributes (this may be the problem in and of itself). I have a previous lightning component that has about 16 attributes and passing them all through as method parameters was messing (there is probably a better way of doing that). Here is a more basic example:
WRAPPER CLASS
public class CreditAppWrapper {
@AuraEnabled Credit_Application__c creditApp {get;set;}
@AuraEnabled Business__c business {get;set;}
@AuraEnabled Vehicle__c equipment {get;set;}
@AuraEnabled List<Applicant__c> principals {get;set;}
}
COMPONENT
<aura:attribute name="cApp" type="CreditAppWrapper"/>
...
<lightning:input type="String" label="NAME" value ="{!v.cApp.Business.Name}"/>
JS CONTROLLER
console.log(component.get("v.cApp.Business.Name"));
This logs null as the value
Is this because I can't have multiple levels on the input (ie. cApp & Business & Name)? Do I need to instantiate the wrapper class first?