You need to sign in to do that
Don't have an account?
Venky1219
Problem in binding picklist type field using inputfield
Hi,
I am using inputfield to populate picklist on my page but when I select a value and save its not binding, controller not able get value which is selected.
I am using inputfield to populate picklist on my page but when I select a value and save its not binding, controller not able get value which is selected.
<apex:pageBlockSection > <apex:inputField value="{!country.Languagecode__c}"/> <apex:pageBlockSectionItem > <apex:CommandButton value="Save" action="{!save}"/> </apex:pageBlockSectionItem> </apex:pageBlockSection>
public class CostomController{ public Country__c country{set;get;} public CustomController(){ country = new Country__c(); } public PageReference save(){ System.debug('selected value:' + country.Languagecode__c); return null; } }Above debug statement returning " selected value:null "
Please find the below code:
ControllerClass:
I also tested the code in environment and everything looks good.
Please do let me know id helps you.
Regards,
Mahesh