I have an AppSettingsController and a VisualForce page and on the page the user enters config settings into the app. Things like a username and password and a web service URL. The web service retrieves data and this data is added to Salesforce as leads.
I want them to set a campaign on the VF page so that the data retrieved from the web service is also added to a specific campaign.
Right now I have added a select list to the page, and in my controller I have added a field to the class, I am assigning the field values but nothing is displayed in the view.
Here is the required info from the page
<apex:page Controller="AppSettingController" docType="html-5.0">
<apex:messages />
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection title="Settings" columns="1">
<apex:pageblockSectionItem >
<label>Campaign</label>
<apex:selectlist>
<apex:selectoptions value="{!campaigns}"/>
</apex:selectlist>
</apex:pageblockSectionItem>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
And in my controller:
public with sharing class AppSettingController
{
public List<String> campaigns;
public AppSettingController()
{
setView();
}
public void setView()
{
campaigns = new List<String>();
campaigns.add('Campaign test');
}
}
When the page is rendered, the selectlist is just an empty control.