You need to sign in to do that
Don't have an account?
Lightning Practice
how to make default values for picklist value in map?
Hi All,
Please help
how to make default values for picklist value in map?
In main component i have sub component
pickValuesMap am getting all the field values as here {"Name":"Case Number",other values,"Name":"Status","PicklistValues:["New","Open"]"}
How to Make default picklist value Status with "New"
Thanks,
Lightning Practice.
Please help
how to make default values for picklist value in map?
In main component i have sub component
<aura:component> <aura:attribute name="pickValuesMap" Type="Map" default="{}"> <c:caseComp metadata="{!v.pickValuesMap.Status}" value="{!v.Obj.Status}" isEdit="true"/> </aura:component>
pickValuesMap am getting all the field values as here {"Name":"Case Number",other values,"Name":"Status","PicklistValues:["New","Open"]"}
How to Make default picklist value Status with "New"
Thanks,
Lightning Practice.
You should post the code for the component caseComp.
It is just a drop down list with a selected value or a real field of type picklist of an existing object (the "default" value is either the last stored value or the default value defined for the field itself).
Thanks for the response.
In CaseComp am getting whole the Case Reocrd information from the Metadata.
Map holds all the case record information.All the picklist values retrieved from schema level.here the problem is picklist value is not default at schema level. I want to make it default in component level.
By default status has to be 'New'.
Thanks,
Lightning Practice
Attribute of <option>: selected="{!item.selected}"
Generating Options On Initialization
Use an attribute to store and set the array of option value on the component. The following component calls the client-side controller to create options during component initialization.
https://developer.salesforce.com/docs/component-library/bundle/lightning:select/documentation
This is not am expecting ,
Thanks for suggestion.
Thanks .
Lightning practice
The interface of the component is not sufficient (c:caseComp). We solve this kind of problem very easily each day (<option>: selected) but that is your own code that is the problem.
As i am holding array of picklistvalues in object[]
In the options am getting array of all Picklistvalues like type,status fields etc.
I need to set default value for Status with new in controller.Js
please help is aprreciated.
Thanks ,
Lightnig Practice