Skip to main content
I'm encountering a weird situation in using lightning:tabset, apparently, if the user has not yet navigated (or activated) a tab, the child component in it will be undefined thus any attributes in that component will not be accessible. 

For example... If I have not activated tab2 (meaning, the user did not click tab2 yet) then component.find('tab2') will be undefined. 

 

<lightning:tabset>

 <lightning:tab tab1>

    <c:component_in_tab1 aura:id="tab1" />

 </lightning:tab>

 <lightning:tab tab2>

    <c:component_in_tab2 aura:id="tab2" />     

  </lightning:tab>

</lightning:tabset>

 

var cmp = component.find('tab2');   // THIS THROWS UNDEFINED

var dataAttribute = cmp.get('v.myAttribute');

 
2 answers
0/9000