+ Start a Discussion

How to get selected option if there are multiple SelectList on visualforce page and SelectList are dynamic it may be Zero or more that is not predictable ?

Shashikant SharmaShashikant Sharma
Could you explain your problem more.
Shaijan ThomasShaijan Thomas
could you please provide the more details on this
Yes sure,
I am newbie to developement 
If there are so many picklist on visualforce page and we want to retieve all selected values of all picklist in apex controller then how can we implement it ?
Shaijan ThomasShaijan Thomas
<apex:selectList size="1" value="{!SelectedValue}">
	<apex:selectOptions value="{!ListOfValueInPicklist}"/>

//Class Code
 public string selectedValue {get;set;}
 public List<SelectOption> getListOfValueInPicklist() {
        List<SelectOption> PickListP = new List<SelectOption>();
        PickListP.add(new SelectOption('','-None-'));
        PickListP.add(new SelectOption('INDIA','India'));
        PickListP.add(new SelectOption('USA','USA'));
        return PickListP;

Try this