I have multiple select lists on my vf page. All work fine, except this one:
<apex:pageBlockSection title="Product" >
<apex:pageBlockSectionItem rendered="true">
<apex:outputLabel value="{!$ObjectType.ZInstallation__c.fields.DiscountProfile__c.Label}" rendered="true" />
<apex:selectList value="{!ZInstallation__c.DiscountProfile__c}" size="1" rendered="true" >
<apex:selectOptions value="{!DiscountProfileList}" />
</apex:selectList>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>
The list should show data from custom object (like other lists too). The controller:
public List<SelectOption> getDiscountProfileList() {
List<SelectOption> options = new List<Selectoption>();
List<ZDiscountProfile__c> profileList = [SELECT Id, Name FROM ZDiscountProfile__c ORDER BY Name];
options.add(new selectOption('', 'none'));
for (ZDiscountProfile__c profile : profileList) {
options.add(new selectOption(String.valueOf(profile.Id), profile.Name));
}
return options;
}