You need to sign in to do that
Don't have an account?
Adil_SFDC
Hi I need to get the selected value in my param that needs to be passed to the controller. right now my apex parameter value is hard coded to 06 any help
Pass selectList Parameter to Controller
Hi I need to get the selected value in my param that needs to be passed to the controller. right now my apex parameter value is hard coded to 06 any help
<apex:sectionHeader title="Field Researcher Schedule for Region" /> <apex:selectList value="{!contactSalesRegion}" size="1" multiselect="false"> <b>Field Researcher Schedule for Region</b> <apex:selectOptions value="{!SalesRegionsCoveredValues}"></apex:selectOptions> <apex:actionSupport event="onchange" action="{!salesRegionCoveredFilter}" reRender="dataBlock"> <apex:param name="salesRegionId" assignTo="{!salesRegionId}" <strong><em><u>value="06"</u>></em></strong></apex:param> </apex:actionSupport> </apex:selectList> <apex:outputPanel id="dataBlock"> <apex:pageBlock > <b>Scheduled Date</b> <table class="list" border="0" cellpadding="0" cellspacing="0">
public class PhotoSchedulerController { public String salesRegionId { get; set; } public String ContactSalesRegion {get;set;} public List<Contact> contactsToDisplay {get;set;} public void salesRegionCoveredFilter() { system.debug('sales Region ID:'+salesRegionId);// HERE I NEED SELECTED VALUES FROM PICK LIST // getDataRows(); } public List<SelectOption> getSalesRegionsCoveredValues() { List<SelectOption> options = new List<SelectOption>(); Schema.DescribeFieldResult salesRegion = Contact.Sales_Regions_Covered__c.getDescribe(); List<Schema.PicklistEntry> salesRegions = salesRegion.getPicklistValues(); for(Schema.Picklistentry entry : salesRegions){ options.add(new SelectOption(entry.getLabel(),entry.getValue())); } return options; }
This is how I get the selected value of the picklist in the apex controller
Hope this helps!
Prady