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
Bhola VishwakarmaBhola Vishwakarma 

picklist problem

 

 public List<string> getGeneralExpense(){
        List<string> options = new List<string>();
        Schema.DescribeFieldResult field = Schema.sObjectType.expense__c.fields.General_Expenses__c;
        List<Schema.PicklistEntry> picklist = field.getPicklistValues();
        for(Schema.PicklistEntry p : picklist) {
            options.add(p.getLabel());
        }
        return options;
    }

 

 

can u give an explanation about code

 

kiranmutturukiranmutturu

here you are getting the picklist values of the respective object dynamically....

Bhola VishwakarmaBhola Vishwakarma

So Kiran, can u tell me that how can store entire picklist values which comes as dynamically in outputText or as CommandLink....

Please tell me this things bcoz I am getting values which comes as dynamically but not able to show on VFPage...

I tried this things..

 

<apex:pageBlockTable value="{!DynamicThings__c}" var="obj">

<apex:column>

<apex:outputText value="{!obj.picklist2__c}">

</apex::column>

</apex:pageBlockTable>

kiranmutturukiranmutturu

to show the picklist values in the vf page you have to use the select list component and selectoption to fill the values.....