3

I am facing an issue in lightning where force:inputfield is not rendering at all. Here is the code:

    <aura:component implements="force:appHostable,force:lightningQuickActionWithoutHeader,force:hasRecordId" >
        <aura:attribute name="newBPTask" type="Cost_Authorization__c"
             default="{ 'sobjectType': 'Cost_Authorization__c',
                             'Name': '',
                             'Pending_Approval_Amount__c' : 0
                             }"/>
      <!-- Input Form using components -->
      <div class="container">
        <form>
                <force:outputField value="{!v.newBPTask.Pending_Approval_Amount__c}"/>
                <force:inputField aura:id="RequestBudget"  value="{!v.newBPTask.Pending_Approval_Amount__c}" required="true"/>
        </form>
      </div><!-- ./container-->
    </aura:component>

I am sure I am doing a silly mistake but could not find. Could anyone look into this and suggest?

marked as duplicate by Eric, Brian Mansfield, Vamsi Krishna, Ratan Paul, Raul Mar 7 '17 at 19:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Thanks @Eric , I have already gone through that post.It seems, there they faced this issue only when they use fields inside <article></article>. In my case, I am just trying to render a field. – AbhishekDEV Mar 6 '17 at 15:18
  • Ok, then this post: salesforce.stackexchange.com/questions/64580/… – Eric Mar 6 '17 at 15:20
  • It is close to my question. But still in my case, I have already used <aura:attribute> as suggested there to link object type and have set a "default" but no success. This component "force:inputField" is so confusing. Not sure what I am missing here or doing wrong. – AbhishekDEV Mar 6 '17 at 15:27
  • 1
    Is there a reason you're not using <label> or <div> tags? I've always avoided using those <force:outputField> and <force:inputField> because they have caused some issues. – akcorp2003 Mar 6 '17 at 16:03
  • 1
    There is no specific reason for not using <label> or <div>. I just wanted to see behavior of <force:inputField> but seems there is no consistency in rendering of this component(inputfield). All, I just want to know what is wrong in above implementation. – AbhishekDEV Mar 7 '17 at 9:10