You need to sign in to do that
Don't have an account?
Show selectList as dropdown - am I missing something
I am trying to output a custom picklist in a visualforce page
This works fine - but I'm lost to how to make it display as a drop-down
<apex:page controller="sampleCon"> <apex:form > <apex:selectList value="{!countries}" multiselect="true"> <apex:selectOptions value="{!items}"/> </apex:selectList><p/> <apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/> </apex:form> <apex:outputPanel id="out"> <apex:actionstatus id="status" startText="testing..."> <apex:facet name="stop"> <apex:outputPanel > <p>You have selected:</p> <apex:dataList value="{!countries}" var="c">{!c}</apex:dataList> </apex:outputPanel> </apex:facet> </apex:actionstatus> </apex:outputPanel> </apex:page>
Please can someone point me in the right direction - thanks
Here is the trick
<apex:selectList value="{!countries}" multiselect="false" size="1">
All Answers
You can't do multi-select as a drop-down, I believe if you change that setting I think it'll fix it?
Actually removed that - it just all values in select list. Know what I mean?
Here is the trick
<apex:selectList value="{!countries}" multiselect="false" size="1">
Thanks Mike you saved my day!