You need to sign in to do that
Don't have an account?

Unable to see the selected options of drop down
Hi,
I have visualforce page which uses custom settings as select list and when I select few of the names then those needs to be displayed.
I have shown the select opions but I am not able to see the selected values in the output. (ie., after the message "You have chose" I am not getting any output.
CODE
--------
a) controller class
public class customsettingcontroller {
public string[] ISOSelected {get;set;}
public PageReference test() {
return null;
}
public list<SelectOption> getISOCodes() {
List <SelectOption> listCodes = new List<SelectOption>();
for (Country_Code__c cCode : Country_Code__c.getAll().values())
listCodes.add(new selectoption(cCode.ISO_Code__c, cCode.Name+'--'+cCode.ISO_Code__c));
return listCodes;
}
}
b) visualforce page
<apex:page controller="customsettingcontroller">
<apex:form >
<apex:pageBlock title="Country Codes">
<apex:selectList value="{!ISOSelected}" multiselect="true">
<apex:selectOptions value="{!ISOCodes}"></apex:selectOptions>
</apex:selectList>
<apex:actionSupport event="onselect" action="{!test}" rerender="output" status="status"/>
</apex:pageBlock>
</apex:form>
<apex:outputPanel id="output">
<apex:actionStatus id="status" startText="testing...">
<apex:facet name="stop">
<apex:outputPanel >
You have chose:
<apex:dataList value="{!ISOSelected}" var="a">{!a}</apex:dataList>
</apex:outputPanel>
</apex:facet>
</apex:actionStatus>
</apex:outputPanel>
</apex:page>
Please help me on this.
Thanks,
JBabu.
Hi JBabu,
I suspect you might just need to move the closing </apex:form> tag down so that the output panel is contained inside it. Give that a go and see if it helps!
Matt
Hi Matt,
I have tried that and it didnot work.
Thanks,
JBabu.