Activity Forums Salesforce® Discussions How do I get a selectList in my VF page for a custom case controller to work?

  • Gaurav

    Member
    May 24, 2016 at 3:06 pm

    Hi
    Please use this, hope it will help you.

    <apex:page>
    <apex:pageBlock >
    <apex:pageBlockSection >
    <apex:selectList value="{!orderFieldStaff}" size="1" label="Field Staff" onchange="first()">
    <apex:selectOptions value="{!fieldStaff}" >
    </apex:selectOptions>
    </apex:selectList>
    </apex:pageBlockSection>
    </apex:pageBlock>
    </apex:page>

    Thanks

     `public string orderFieldStaff{get;set;}
    public List fieldstaffList{get;set;}
    public List
    getfieldStaff(){

    system.debug('@@enter++++++');
    fieldstaffList = new List();

    Schema.DescribeFieldResult fieldResult = Order.field_staff__c.getDescribe();

    List ple = fieldResult.getPicklistValues();

    for( Schema.PicklistEntry f : ple)
    {
    fieldstaffList.add(new SelectOption(f.getLabel(),f.getValue()));
    }
    return fieldstaffList;
    }`

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos