Ask Search:

how to get the page parameters in the controller?

In visual force page i have command button which is taking a parameter as below:

<apex:commandButton action="{!showPopUp}" value="Popup">
        <apex:param name="cmd" value="show"/>

In the controller class I have a showPopUp() method as below:

public Pagereference showPopUp() {
        String param = ApexPages.currentPage().getParameters().get('cmd');
        System.debug('Debug : ' + param);
        if(param.equals('show')) {
            popUp = true;
        } else if(param.equals('close')) {
            popUp = false;
        return ApexPages.currentPage();

But I am getting the "param" value as "null".

Is there any thing wrong with this code? How can I get the parameter vaue?
Sunil KeshariSunil Keshari

Developer forum is the best place to get answers for these questions.