public class DependentPicklistController{ public List accounts {get;set;} public List contacts {get;set;} public DependentPicklistController(){ accounts = [select id, name, (select id from contacts) from account limit 1000]; contacts = [select id,accountid, name from contact where accountid !=null limit 1000]; } }