I'm a relative newbie so please be gentle…
I've created a visualforce page using a custom controller. The VF page contains a number of fields and a drop down list (i.e. Industry) from which users can search for data. I would like the VF page to display 'All Industries' on page load. However, I can't get this to work.
My constructor snippet is as follows:
public MyController(){
AccountList = new list<AccountSubClass>();
AccountSelectedSet = new set<Id>();
Industry = ApexPages.currentPage().getParameters().get('All Industries');
BuildQuery();
}
Grateful for any assistance. Happy to provide more details if it helps…
Best Answer
You have a couple of options here, you can either build your drop-down list in your Visualforce page or you can build it in apex. To do it in Visualforce, you just need VF markup that looks something like this:
And the apex for that would look something like this:
Alternatively, you can build your list of SelectOptions in apex and repeat over them on the page. The apex for that would look like this:
And the apex for that would look something like this: