I am facing an issue where a select list value default selected getting passed fine to controller during compile and page load. But on change simply it's even not coming on debug statement.


<div class="panel panel-primary">
  <div class="panel-heading">
    <h3 class="panel-title">Campaign</h3>
  <div class="panel-body">
        <apex:selectList value="{!selCampaign}" size="1">
          <apex:selectOptions value="{!campaigns}" />
          <apex:actionSupport action="{!updProductList}" event="onchange" status="actStatusId"  reRender="pivot, hierPb, pb"/>

Apex code in constructor itself

Set<String> SplitList = New Set<String>();
system.debug('selCampaignName@1'+selCampaignName); // Not coming after selcampaign - value change on page
system.debug('selCampaign@1'+selCampaign); // Not coming after selcampaign - value change on page
for(Sample_Order_Campaign_abv__c so : [SELECT Franchises_abv__c FROM Sample_Order_Campaign_abv__c WHERE Name =:campaignMap.get(selcampaign)]) {
  IF(!string.isBlank(so.Franchises_abv__c)) SplitList.addAll(so.Franchises_abv__c.split(';;'));

2 Answers 2


An Apex controller constructor only runs when the page is first opened. When an apex:actionSupport or apex:commandButton runs the controller, the controller instance is re-created from the view state embedded in the page i.e. the field values of the instance are restored by copying the data rather than running code such as the constructor.

Add your debug statements to the updProductList method to that is run immediately after the controller instance has been re-created to check the selCampaign value.


Try do something like this:

<apex:page showHeader="false" sidebar="false" controller="bookList">
    <apex:form id="frmId">
            <apex:selectList value="{!selectedValue}" multiselect="false" size="1">
                <apex:selectOptions value="{!aList}" />
                <apex:actionSupport action="{!bookList}" event="onchange" reRender="frmId"/>
            <apex:outputText value="{!myStr}" />
  • what's the outputtext here? Dec 9, 2016 at 8:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .