0

I have created modal in component and added <force:inputField inside it, but it is not displayed on the modal popup.

enter image description here

But, if the same <force:inputField is added in the component, then it displayed on the component.

enter image description here

Component:

<aura:attribute name="contactOnAccount" type="Custom_Opportunity_Contact_Role__c" 
               default="{ 'sobjectType': 'Custom_Opportunity_Contact_Role__c' }"/>

<aura:if isTrue="{!v.editOCRModal}">
        <div aura:id="new-ocr" class="" style="">
            <div role="dialog" tabindex="-1"  class="slds-modal slds-fade-in-open">
                <div class="slds-modal__container main-modal-container slds-modal slds-fade-in-open">
                    <div class="slds-modal__header">
                        <div aura:id="new_ocr_setting_modal" class="slds-text-heading--small modal-header">New Priority Points Settings</div>
                        <div class="close_modal"> 
                            <lightning:buttonIcon iconName="utility:close" alternativeText="Close" iconClass="light" size="x-small" class="add_ocr" onclick="{!c.closeModal}" />
                        </div>
                    </div>
                    <div class="slds-modal__content slds-p-around--medium content">
                        <label class="slds-custom-label">Contact</label> 

                        <force:inputField aura:id="test_lookup_field" value="{!v.contactOnAccount.Contact__c}"/>

                    </div>
                </div>
            </div>
            <div class="slds-backdrop slds-backdrop_open"></div>
        </div>
    </aura:if>

How to display force:inputfield on the modal popup?

  • Do you see any error in console? I literally copy pasted your code except for the SObject type here and it just works fine. – Jayant Das Jan 10 at 17:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.