You have to populate a List<SelectOption>
to bind with the UI. Also have a variable to grab which have been selected from the select options. In your controller have below codes
public String selectedVal{get;set;} // This will hold the selected value, the id in here
public List<SelectOption> getopenPresentationOptions(){
List<SelectOption> optns = new List<Selectoption>();
optns.add(new selectOption('a09N0000002R0oeIAC', 'First// Name'));
before getting here you must populate your queryResult optns.add(newlist selectOption('a09N0000002R0p4IAC',with 'Secondrequired Name'));fields
optns.addfor(newYour_Object selectOption('a09N0000002R0dpIAC',obj 'Third: Name')queryResult);{
optns.add(new selectOption('a09N0000003LxoEIAS'obj.Id, 'Fourth Name'obj.Name));
}
return optns;
}
VF Page:
<apex:selectList value="{!selectedVal}" size="1">
<apex:selectOptions value="{!openPresentationOptions}" />
</apex:selectList>
UPDATE : added code so that selectoptions list will be populated with a query result