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
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 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 ?