As per my understanding (and correct me if I'm wrong), but the picklist values will only be populated if you bind them to an inputField component using a standardController. Is there any way to grab the picklist values of a field using a custom controller? With the API you can grab this information with a describe call, is there something similar with Apex Code?
inputField will work with any controller. It is aware of the field type and other field level attributes directly and is not controller dependent.
Notably, you can use custom classes with standard controller starting int winter '08. While that really doesn't change things here I thought you might be interested to know that as you are probably dropping into custom controllers because you need to do some things the standard controller won't let you do. In winter '08 you can have the best of both worlds.
Thanks for the insight! I don't think I was specific enough in my previous post, however. What we are trying to do is (using a custom controller until Winter '08) output a picklist field from a custom object. Using Andrew's suggestion I was able to recreate the picklist with appropriate values for SF-native fields (such as {!case.type}), but when applying similar logic to fields on custom objects, the field is not recognized:
my_picklist__c is a picklist on foo__c:
Code:
All Answers
If you bind a picklist to the inputField component it will get the values automatically.
As per my understanding (and correct me if I'm wrong), but the picklist values will only be populated if you bind them to an inputField component using a standardController. Is there any way to grab the picklist values of a field using a custom controller? With the API you can grab this information with a describe call, is there something similar with Apex Code?
inputField will work with any controller. It is aware of the field type and other field level attributes directly and is not controller dependent.
Notably, you can use custom classes with standard controller starting int winter '08. While that really doesn't change things here I thought you might be interested to know that as you are probably dropping into custom controllers because you need to do some things the standard controller won't let you do. In winter '08 you can have the best of both worlds.
Regards,
Code: Is this something that is possible now or will I just have to wait for the extensions capability in next month?
Thanks again!
my_picklist__c is a picklist on foo__c:
Code: