+ Start a Discussion
test777test777 

Urgent:displaying another custom object records in vf page.

Hi All,

     i want to display the pick list in vf page.In that pick list i want to display the another custom object records.Its urgent.Any one can u please help me this.

 

Thanks in advance.

VishwanathVishwanath

Hi,

try this it might be helps you

public class pickvalues
{
Public String str{get;set;}
public list<selectOption> getpickvalue()
{
public List<SelectOption> opp=new List<SelectOption>();
opp.add(new SelectOption('',--none--);
for(Account Ac:[select id,name from Account])
{
opp.add(new SelectOption(ac.name,ac.name);
}
return opp;
}
}

<apex:Page controller="pickvalues">
	<apex:outputLabel value="Account Records" for="mgr"></apex:outputLabel>
					<apex:selectList id="mgr" value="{!str}" size="1" title="Manager">
						<apex:selectOptions value="{!pickvalue}">
						</apex:selectOptions>
					</apex:selectList>
					</apex:page>