You need to sign in to do that
Don't have an account?
Raymond Airey
Adding Customer Picklist to Visualforce Page
Hi All,
I am very new to Apex coding and I am trying to learn how to add a custom picklist field to a Visualforce page.
I am trying to work with the below:
Any help would be great!
I am very new to Apex coding and I am trying to learn how to add a custom picklist field to a Visualforce page.
I am trying to work with the below:
- A customer field called "Type_of_Sales__c" within the standard OpportunityLineItem object
- The custom field contains the following items
- Sample
- Normal Sales
- Inspection Copy
- Schools Direct
<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Type_of_Sales__c.Label}"> </apex:column>I have tried using the following code, which again shows the heading but no list:
<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Type_of_Sales__C.Label}"> <apex:inputField value="{!OpportunityLineItem.Fields.Type_of_Sales__C}" </apex:column>All I'm am trying to do is display to customer picklist as you would normally see it on a page.
Any help would be great!
Here is a sample code for you to refer.
Your input field is supposed to be like this, if you are using the StandardController. Let me know if this helps.
Thanks for your reply!
I have changed my code to look like the below: But I get the following error: Any ideas what the issue might be?
I have now created the following code: Which works perfectly but if I save my 'Product' selection's and then re-enter the page, I get the following error:
But if I change my code to the following: The code works without the error but I'm also missing my dropdown box.
Any pointers would be great?