1

I'm trying to call this function but the debug statement is not working.

<apex:selectList value="{!year}" title="Yıl" id="yearFilter" multiSelect="false" size="1" >
            <apex:selectOptions value="{!years}"/>
         <apex:actionSupport event="onchange" action="{!setSelectedMethod}" reRender="refreshSection" status="status" />
        </apex:selectList>

Apex

public void setSelectedMethod(){
        System.debug('setselectedmethod##');
        dataRefresh(userId);
    }

Any help is much appreciated.

1
  • i presume your debug logging level is set to Apex DEBUG and not INFO, WARN, or ERROR?
    – cropredy
    Commented Nov 27, 2019 at 18:40

1 Answer 1

2

The code you have given is working for me (I'm getting a debug).

Perhaps the mistake is elsewhere?

Working code:

<apex:page controller="sotestcontroller">
    <apex:form>


    <apex:selectList value="{!year}" title="Yıl" id="yearFilter" multiSelect="false" size="1" >
            <apex:selectOptions value="{!years}"/>
         <apex:actionSupport event="onchange" action="{!setSelectedMethod}" reRender="refreshSection" status="status" />
        </apex:selectList>
        </apex:form>
</apex:page>
public class sotestcontroller {
    public String year {get; set;}
    public list<Selectoption> years {get; set;}

    public sotestcontroller(){

        this.years = new list<selectOption>();
        years.add(new SelectOption('1','1'));
        years.add(new selectOption('2', '2'));

    }

    public void setSelectedMethod(){
        System.debug('setselectedmethod##');
        //dataRefresh(userId);
    }

You must log in to answer this question.

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