i want to disply picklist value based on query value in my controller. but its display nothing . the code is like:
<apex:page controller="Pre_process2">
<apex:form >
<apex:pageBlock title="Pre Process Payroll">
<apex:pageBlockSection columns="2" showHeader="false" >
<apex:outputLabel value="Period Code" for="accts"></apex:outputLabel>
<apex:selectList id="PeriodCode" value="{!PeriodCode}" size="1" title="Period Code">
<apex:selectOptions value="{!PeriodCode}"></apex:selectOptions>
</apex:selectList>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
the controller is:
public with sharing class Pre_process2 {
public String PeriodCode {get; set;}
//public visualforcepage_picklist(ApexPages.StandardController stdController)
//=============================== get picklist value for Period Code ==================================
public List<selectOption> getPeriodCode()
{
List<selectOption> options = new List<selectOption>();
options.add(new selectOption('', '- None -'));
List<aggregateResult> results = [SELECT Period__r.name FROM HREMPASSIGNMENT__c group by Period__r.name];
for (AggregateResult ar : results)
{
string name = string.valueOf(ar.get('Name'));
options.add(new selectOption(name, name));
}
return options;
}}
do i miss something?
thanks and regards
Willy