Activity Forums Salesforce® Discussions force:inputField with condition stops working

  • Abhinav

    Member
    August 16, 2016 at 10:37 am

    Hi Arun,

    Which condition you are using with the inputfield?

    • This reply was modified 8 years, 2 months ago by  Abhinav.
  • Arun

    Member
    August 16, 2016 at 10:39 am

    Hi Abhinav,

    You can assume of any condition which is driving true. In my case I am using event so using only that attribute.

    Also I did check condition is giving true as this component is displaying perfectly only lookup stopped working.

    Thanks,
    Arun

  • Abhinav

    Member
    August 16, 2016 at 10:46 am

    Hi Arun,

    Which event you are using?

  • Arun

    Member
    August 16, 2016 at 12:29 pm

    I am using my own custom event to pass some value that is being used in the condition.

  • Piyush

    Member
    August 17, 2016 at 11:58 am

    Hello Arun,

    The attribute must be a Boolean type.

    Here is the sample of code wich work fine if i use attribute type is Boolean .

    <aura:component >
    <aura:attribute name="contact" type="Contact"
    default="{ 'sobjectType': 'Contact' }"/>
    <aura:attribute name="showLookup" type="Boolean" default="true"/>
    <aura:attribute name="showLookup1" type="string" default="true"/>

    <aura:if isTrue="{!v.showLookup}">
    <force:inputField value="{!v.contact.AccountId}"/>
    </aura:if>
    </aura:component>

     

     

  • Arun

    Member
    August 17, 2016 at 3:34 pm

    Hi Piyush,

    Thank you for your help. But as per my info "isTrue" should be Boolean type but in that we can pass any condition which is giving Boolean result like we do in VF page for IF condition.

    And also I have seen for "" this is working but unfortunately it has been deprecated so can;t go with that.

    https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/aura_compref_aura_if.htm

    Thanks
    Arun

  • Arun

    Member
    August 17, 2016 at 3:35 pm

    It was working for "<aura:renderif>"

Log In to reply.

Popular Salesforce Blogs