I am having this particular issue with lightning components while using force:inputfield within lightning:tabset.

Here is my component code:

<aura:component controller="AutoTableController" implements="flexipage:availableForAllPageTypes">
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <aura:attribute name="opp" default=" { sobjectType : 'Opportunity'} " type="Opportunity" description="Pass the Opportunity which is to be edited" />
    <aura:attribute name="isEditEnabled" type="Boolean" description="If set to yes, will enable the edit node" />

    <lightning:tabset aura:id="tabset">
        <lightning:tab label="ACP">
            <aura:set attribute="body">
                <force:inputField aura:id="plan" value="{!v.opp.AccountId}" />
                <ui:outputText value="{!v.opp.Name}"></ui:outputText>
                <h3 class="slds-section-title--divider">Section Information</h3>

The doinit method fetched an opportunity record and does update the view as I am able to see the opportunity name but the force:inputfield is not rendered even though opportunity is linked to an account.

More Information:

  1. I am fetching two fields from Apex Controller: Name, AccountId
  2. The data json that is recived by controller method is {"Name":"MS_No Territory","AccountId":"00136000003FIu6AAG","Id":"006360000049pUOAAY"}
  3. I am System Administrator
  4. If I move the code out of tab component, it works perfectly.

I am using an attribute for Opportunity as lightning:tabset documentation says:

This component creates its body during runtime. You won’t be able to reference the component during initialization. You can set your content using value binding with component attributes instead.

  • I ran into the same problem. i was just wondering, if you have solved this issue ? – naruto-sfdc Mar 2 '17 at 20:15
  • @naruto-sfdc Sorry. I was not able to and moved to Jquery Tabs. – manjit5190 Jul 24 '17 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.