public with sharing class PickList_Page_Controller {
public String val { get; set; }
public List<String> Allvalues {get;set;}
public List<SelectOption> ListValues {get;set;}
public PickList_Page_Controller(){
Allvalues = new List<String>{'None', 'Red', 'Pink', 'Black','Orange', 'blue', 'Green'};
ListValues = new List<SelectOption>();
for(String s : Allvalues){
ListValues.add(new SelectOption(s, s));
}
}
}
I hope it helps you.
Kindly let me know if it helps you and please mark as Best Answer.
Hi Himanshu, Here (https://modapk.pro/4liker-apk/) I am putting some color names in List "All values ". Then I am putting all color values in the pick list. VF page code - view sourceprint? 1<apex:page controller="PickList_Page_Controller"> 2 <apex:form > 3 <apex:pageBlock > 4 <apex:selectList value="{!val}" size="1"> 5 <apex:selectOptions value="{!ListValues}"></apex:selectOptions> 6 </apex:selectList> 7 </apex:pageBlock> 8 </apex:form> 9</apex:page>
Hi Himanshu,
Here I am putting some color names in List "Allvalues ". Then I am putting all color values in the pick list.
VF page code -
Controller Code -
I hope it helps you.
Kindly let me know if it helps you and please mark as Best Answer.
Thanks and Regards,
Biswojeet,
Try following code helps for you:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi
Here (https://modapk.pro/4liker-apk/) I am putting some color names in List "All values ". Then I am putting all color values in the pick list.
VF page code -
view sourceprint?
1<apex:page controller="PickList_Page_Controller">
2 <apex:form >
3 <apex:pageBlock >
4 <apex:selectList value="{!val}" size="1">
5 <apex:selectOptions value="{!ListValues}"></apex:selectOptions>
6 </apex:selectList>
7 </apex:pageBlock>
8 </apex:form>
9</apex:page>