+ Start a Discussion
Vidhyasagaran MuralidharanVidhyasagaran Muralidharan 

Values not updating in picklist

vf page:
<apex:page controller="vfcontrol" showHeader="false" sidebar="false">
<apex:form >
<apex:selectList size="1">
<apex:selectOptions value="{!selectedObject}"/>
</apex:selectList><p/>
</apex:form> 
</apex:page>

Apex code:
Public Class vfcontrol{
public List<selectoption> selectedObject {get; set;}
public vfcontrol()
{
selectedObject = new List<selectoption>();
}
Public void Objectnames()
{
for(Schema.SObjectType objTyp : Schema.getGlobalDescribe().Values()){
selectedObject.add(new selectoption(objTyp.getDescribe().getLocalName().toLowerCase() ,objTyp.getDescribe().getLabel() ));
}
}
}
Plese help me object name arenot displaying in vf page
Jim JamJim Jam
Make a call to the Objectnames() method right after declaring the selectedObject = new list<selectoption>(); line in your vfcontrol() constructor method. If that doesnt work create a getter method for the selectedObject list variable which contains the logic and returns the list.
Vidhyasagaran MuralidharanVidhyasagaran Muralidharan
<apex:page controller="vfcontrol" action="{!Objectnames}"showHeader="false" sidebar="false">
whether this will work ?