You need to sign in to do that
Don't have an account?
ajith kumar 35
get id's of slected values of selectlist
I need the id of selected values from selectlist in my apex
page:
page:
<apex:page controller="test"> <apex:form> <apex:pageBlock> <apex:pageBlockSection> <apex:OutputPanel > <apex:selectList value="{!selectedwing}" size="5" multiselect="true" > <apex:selectOptions value="{!ListOfwing}"/> </apex:selectList> </apex:OutputPanel> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>controller:
public with sharing class test { public list<String> selectedwing{set;get;} public List<SelectOption> getListOfwing(){ List<Wing__c> wing = [select id,name from Wing__c] ; List<SelectOption> wingOptionList = new List<SelectOption>(); for(Wing__c u : wing ){ wingOptionList.add(new SelectOption(u.name , u.Name)); } return wingOptionList; } public test(){ } }
Refer this code and let me know if u face any issue
All Answers
Refer this code and let me know if u face any issue