function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lago S.p.a.Lago S.p.a. 

Current Picklist of record does not show in visualforce

Hi experts!
I have a little problem with a simple force.com site that I'm building.
I want to see a list of contacts with basic info, one of these info is a picklist field, but when I render the page, this picklist show the first value of list instead of the current value of the record.
Here's my VF Code of the picklist:
VF
<apex:pageBlockSectionItem >
                                    <apex:outputLabel value="{!$ObjectType.Contact.fields.type__c.label}" />
                                    <apex:selectList styleClass="slds-input"  value="{!statusOptions}"   size="1">
                                        <apex:selectOptions value="{!ItemsList}" rendered="true"/>
                                    </apex:selectList>
                                </apex:pageBlockSectionItem>
And the method of the controller:

public List<Selectoption> getItemsList(){
        List<SelectOption> options = new List<SelectOption>(); 
        List<Schema.Picklistentry> fieldResult = Schema.Contact.type__c.getDescribe().getPicklistValues();
        //options.add(new SelectOption());
        for(Schema.PicklistEntry f : fieldResult) {
            options.add(new SelectOption(f.getValue(), f.getLabel()));
        }
        return options;
    }

Any help will be very appreciated! Thanks in advance.
Dushyant SonwarDushyant Sonwar
Replace
<apex:selectList styleClass="slds-input" value="{!statusOptions}" size="1">

With

<apex:selectList styleClass="slds-input"  value="{!Contact.Type__c}"   size="1">

It will show the contact record type value.
Dushyant SonwarDushyant Sonwar
Also , giving you can give FLS to contact type custom field on site
Hot RabattHot Rabatt
I also making a site like yours. The main things I'm doing is sharing about couponcodes. Visit me https://hotrabatte.com/
 
James MorrisonJames Morrison
Šis internetinis lošimo automatas akimirksniu perkelia žaidėjus į saldžią visatą su saldainiais, vaisių simboliais ir kitomis gėrybėmis. Ryškus dizainas ir dėmesį neblaškanti muzika puikiai pabrėžia pagrindinę temą. Žaisti vulcan (https://777vulcan-vegas.com/ru) galite pereidami prie demonstracinės versijos. Turite galimybę mėgautis patirtimi, išlaikydami aukštą lošimo automato kokybę, visas parinktis, gaudami premijas su viena nedidele išimtimi - lošimo automate negalite laimėti tikrų pinigų. Demo versija leidžia geriau suprasti lošimo automatą, susipažinti su taisyklėmis. Išbandykite ją nemokamai, kad geriau suprastumėte lošimo automato galimybes, o tada žaiskite už tikrus pinigus.