You need to sign in to do that
Don't have an account?
mukesh gupta
selectList does not display content
Hi Expert,
I am creating a dropdown list by VF and apex page. but i am not getting the value from drop down, it's display blank.
Please suggest
Thanks
Mukesh
I am creating a dropdown list by VF and apex page. but i am not getting the value from drop down, it's display blank.
<apex:pageBlockSectionItem > <apex:outputLabel value="Card Type"></apex:outputLabel> <apex:selectList value="{!selectedCardType}"> <apex:selectOptions value="{!cardTypes}" /> </apex:selectList> </apex:pageBlockSectionItem> ///////////////////-------------------------------------------//////////////////////////// public String cardTypes { get; set; } public String selectedCardType { get; set; } public List<SelectOption> getCardTypes(){ list<SelectOption> cardtype = new list<SelectOption>(); cardtype.add(new selectOption('Visa','Visa')); cardtype.add(new selectOption('Master Card','Master Card')); cardtype.add(new selectOption('American Express','American Express')); return cardtype; }
Please suggest
Thanks
Mukesh
There were very small mistakes in your , I have done some modification in the code.
Try the code below,
Visualforce Page :
Controller (Apex class):
Regards ,
Akshay
Please mark my answer as a solution if it was helpful.
All Answers
Apex class: Vf page:
Thanks,
Harshit Garg
You can use that in your vfpage.It will work for you.
Thanks,
Harshit garg
There were very small mistakes in your , I have done some modification in the code.
Try the code below,
Visualforce Page :
Controller (Apex class):
Regards ,
Akshay
Please mark my answer as a solution if it was helpful.