1

I have 1 command button and 1 command link which are calling same method "testGet" in action. How we can check which button is clicked in apex method? With command link, I am passing param which is setting globally so even after command button click, those will be available so I cant check with that.

Please help.

Thanks, Sonam

1 Answer 1

1

Instead of passing parameter you can simply call different methods which will be much more simpler to handle.

public String calledFrom{get;set;}

public void calledFromButton(){
    calledFrom = 'button';
    mainMethod();
}

public void invokedFromLink(){
    calledFrom = 'link';
    mainMethod();
}

public void mainMethod(){
    // main logic
}

You must log in to answer this question.

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