You need to sign in to do that
Don't have an account?
Sumitsing Ingle 15
Lightning Component > force:inputField is not working for picklist in Sandbox
I am working on a lightning component where I want to show picklist field using as follows. `
Is there any solution for this ?
<aura:component > <aura:attribute name="conObj" type="Contact" default="sobjectType:'Contact'}"/> <force:inputField value="{!v.conObj.Salutation}" aura:id="pic"/> </aura:component>`The above code works fine in my developer org but not working on sandbox. When I try to run this by adding in an app throws some exception. Although same component works in same sandbox if I replace inputField with outputField.
Is there any solution for this ?
Did you get any solution fot this issue?.
I am also facing the same issue. Please let me know if you get any solution or workaround .
For me the above code is not working in both developer and Sandbox org.
Kindly let me know if the above code is working for you in your developer org.
Thanks in advance.
Vignesh
The picklists and Multi picklists field ar not supported in lightning.
Workaround:
Hope this helps you !
<aura:attribute name="accountList" type="Account[]" />
<ui:inputSelect aura:id="account" label="Select Account"
labelClass="slds-form-element__label" value="{!v.newContact.AccountId}"
required="true">
<aura:iteration items="{!v.accountList}" var="LinkedAcc">
<ui:inputSelectOption text="{!LinkedAcc.Id}" label="{!LinkedAcc.Name}"/>
</aura:iteration>
</ui:inputSelect>
where accountList is loaded with Account list.
I saw wrong syntax of you in your code
Wrong:
<aura:component > <aura:attribute name="conObj" type="Contact" default="sobjectType:'Contact'}"/>
<force:inputField value="{!v.conObj.Salutation}" aura:id="pic"/> </aura:component>
Right:
<aura:component > <aura:attribute name="conObj" type="Contact" default="{'sobjectType':'Contact'}"/>
<force:inputField value="{!v.conObj.Salutation}" aura:id="pic"/> </aura:component>
You need focus in attribute "Default" of aura:component