I am new to visualforce pages apex classes. I need the value of a custom picklist field from a contact in a visualforce page. I wish to know the code to get that value. The visualforce page already uses a (non-standard) controller. Thx.
I have found a link that might be helpful for you. This link will help you to understand how to retrieve the data of any picklist value and display it on the Visualforce page and populate it using <apex:selectList> tags.
Thanks for your quick reply and link Deepak. I have created my apex class ("GetOffice") successfully. Now, In the visualforce page where I need to use the single picklist value, it has this statement at the top:-
Now I get the error: Unknown constructor 'GetOffice.GetOffice(VolPersonalSiteT controller)' It seems I have to create a constructor. Unfortunately, after reading 'Using Constructors' in the Apex Developer Guide I am no wiser.
Hi,
I have found a link that might be helpful for you.
This link will help you to understand how to retrieve the data of any picklist value and display it on the Visualforce page and populate it using <apex:selectList> tags.
https://developer.salesforce.com/blogs/developer-relations/2008/12/using-the-metadata-api-to-retrieve-picklist-values.html
If my answer has helped you to resolve your issue please mark this answer as resolved.
Thanks
<apex:page showHeader="false" id="SiteTemplate" standardStylesheets="false" controller="VolPersonalSiteT" cache="false">
As you can see it already has a controller, so I added mine as an extension:-
<apex:page showHeader="false" id="SiteTemplate" standardStylesheets="false" controller="VolPersonalSiteT" extensions="GetOffice" cache="false">
Now I get the error: Unknown constructor 'GetOffice.GetOffice(VolPersonalSiteT controller)' It seems I have to create a constructor. Unfortunately, after reading 'Using Constructors' in the Apex Developer Guide I am no wiser.