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
Lina CTCLina CTC 

Can not display inputfield as picklist in tab

Hi all,

I am currently are facing an urgent issue with displaying a picklist value in a visualforce page. The field that we are displaying is "website_Location__c" under "Advertisement__c" object and the field is a picklist.

The field is displayed using <apex:inputField> in a visualforce page "websitePost" as:
<apex:inputField value="{!Advertisement__c.website_Location__c}" />

The problem is that I could display this picklist field normally when I load websitePost.page directly. However, when I try to display this page using <apex:tab> in another visualforce page "jobBoards", no value will displayed for this picklist field. 

Also, I have tried this in several orgs, and only a few orgs have this problem. 

Does anyone knows the solution for this? Thank you.  
Martha VMartha V
Is it because of permissions? Usually when I have a problem with something not displaying on my page is a question of the user's profile not having the right permission settings for the object.
Lina CTCLina CTC
Hi Martha, thank you for your answer. But this issue is not because of permission, as this problem only happends when I display the visualforce page in another visualforce page using tab. When I load this visualforce directly, the picklist could be displayed normally.
Rakesh Thota 15Rakesh Thota 15
Hi Lina CTC,

Here is simple code 
public string UserSelectVAlue {set;get;}
public ListOption<SelectOption> getListVal()
{
	ListOption<SelectOption> listValues = new List<SelectOption>();
	listValues.add(new SelectOption('','--None--'));
	for(Custom_object__c s: [select Text__c from Custom_object__c where Text__c != null limit 200])
	{
		listValues.add(new SelectOption(c.Text__c,c.Text__c));
	}
	return listValues;
}



<apex:selectList value="{!UserSelectVAlue}" multiselect="false" size="1">
            <apex:selectOptions value="{!ListVal}"/>
</apex:selectList><p/>
Salesforce has provide a good knowledge doc on this.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectList.htm

Hope this helps you!

Best Regards,
Rakesh Thota.