You need to sign in to do that
Don't have an account?
Giancarlo Amati
how to save the value from a picklist in a VF
Hi Team,
I have a picklist field from the Contact object in my VF page. The code is the one below. However, when I select a value for the picklist and the I continue to complete the form, the Contact records gets refreshed, but the value that I selected on the VF page is not saved automatically in the field.
Am I missing something? does it have to go through the controller?
Thank you,
GC
<apex:pageBlockSectionItem rendered="{!NOT(confirmMode)}" > <apex:outputLabel value="LeadSource" /> <apex:outputPanel layout="block" styleClass="requiredInput"> <apex:outputPanel layout="block" styleClass="requiredBlock"/> <apex:inputfield value="{!contactObj.LeadSource}"/> </apex:outputPanel> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem rendered="{!NOT(confirmMode)}" /> <apex:pageBlockSectionItem rendered="{!(confirmMode)}" > <apex:outputLabel value="LeadSource" /> <apex:outputtext value="{!contactObj.LeadSource}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem rendered="{!(confirmMode)}" />
You can get Reference from this code, maybe it will help you:
///////////Apex Code:
//////////Visualforce Code:
if you have any query please comment.
---------------
If you find your Solution then mark this as the best answer to close this question.
Thank you!
Regards,
Suraj Tripathi
--