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.

  • i presume your debug logging level is set to Apex DEBUG and not INFO, WARN, or ERROR? – cropredy Nov 27 '19 at 18:40
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);
    }
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.