+ Start a Discussion
Adam1Adam1 

can't get selected value from selectList

I can't get the selected value for a selectList back in my controller after the form is submitted. Here is the page code:
 
Code:
      <apex:selectList value="{!selectedId}" multiselect="false" size="10">
        <apex:selectOptions value="{!mySelectOptions}"/>
      </apex:selectList>

I have the get/set methods for my selectedId. Is there some trick involved with getting this value passed to the controller? It's really frustrating trying to get the most straightforward things working in this system...
maheshep.ax379maheshep.ax379
the selected value will be in selectedId array. make sure the string array
//Apex Code
String []selectedId ;
String []getSelectedId ()
{
return selectedId;
}
void setSelectedId(String []id)
{
this.selectedId=id;
}
jwetzlerjwetzler
maheshep, when a selectList has multiselect="false" you need to be binding to String, not String[]