How to display Standard controller Picklist using Apex

The below code is used to display Rating picklist of standard object Account.

<apex:page standardController="Account">

    <apex:form >
   
    <apex:pageMessages />
   
    <apex:pageBlock >
        <apex:pageBlockSection columns="2">
            <apex:pageblockSectionItem >
                <apex:outputLabel value="Rating"/>
            </apex:pageblockSectionItem>       
            <apex:pageblockSectionItem >
                <apex:inputField value="{!Account.Rating}"/>             
            </apex:pageblockSectionItem>           
        </apex:pageBlockSection>       
    </apex:pageBlock>

    </apex:form>

</apex:page>


Output:


2 comments:

  1. how to get the selected picklist value to controller

    ReplyDelete
    Replies
    1. Check this out - http://www.infallibletechie.com/2012/12/rerender-based-on-selectlist-option.html

      Cheers!!!

      Delete