You need to sign in to do that
Don't have an account?
Rung41
Apex Select List not showing any values
I am trying to create an apex:selectList but I am getting stumped. I think the issue resides in my controller extension. I am not a developer by any means so I am not sure what I am doing wrong. The apex list is intended to be a multi select.
<apex:page standardController="Task" extensions="LogACallControllerExtension,NextStep" docType="html-5.0" showHeader="false" standardStylesheets="false"> <apex:form > <div class="app-content"> <header> <h1>Log A Call</h1><br /><br /> </header> <section class="border-bottom"> <div class="content"> <label>Next Steps</label><br /> <apex:selectList id="NextStep" styleclass="sf1input" multiselect="true" value="{!Task.Next_Steps__c}" size="1" /> <apex:selectOptions value="{!NextStepOptions}"/> </div> </section <section class="data-capture-buttons one-buttons"> <div class="content"><apex:commandButton value="Save" action="{!save}" /><br /> </div> </section> </div> </apex:form> </apex:page> **---ControllerExt--** public with sharing class NextStep { public NextStep() { } public NextStep(ApexPages.StandardController controller) { } String[] NextSteps = new String[]{}; public PageReference test() { return null; } public Task task {get; set;} public List<SelectOption> getNextStepOptions() { List<SelectOption> options = new List<SelectOption>(); options.add(new SelectOption('Op1','Op1')); options.add(new SelectOption('Op2','Op2')); options.add(new SelectOption('Op3',Op3)); options.add(new SelectOption('Op4','Op4')); return options; } public String[] getNextSteps() { return NextSteps; } public void setNextSteps(String[] NextSteps) { this.NextSteps = NextSteps; } }
VF-Page:
Since you mentioned multiselect="true", it shows multi-select all the time.
Apex-Class:
In this class, you had missed single-quotes for "Op3". If the above suggestion(s) worked, let us know by marking the answer as "Best Answer" right under the comment which will help the rest of the community should they have a similar issue in the future.
Thanks, Sunil
All Answers
VF-Page:
Since you mentioned multiselect="true", it shows multi-select all the time.
Apex-Class:
In this class, you had missed single-quotes for "Op3". If the above suggestion(s) worked, let us know by marking the answer as "Best Answer" right under the comment which will help the rest of the community should they have a similar issue in the future.
Thanks, Sunil