0

I am calling a JS function to call a pagereference method . This Save button is in an Output panel.

<apex:outputPanel rendered="{!step4}" id="cciPanel">

   <div align="center" draggable="false">
   <!--<apex:commandButton styleClass="slds-button slds-button--neutral" action="{!appenEmailIds}" value="Save" status="busy"/>-->
   <apex:commandButton styleClass="slds-button slds-button--neutral" onclick="appendEmailIds(); return false;" value="Save" status="busy"/>
   <apex:commandButton styleClass="slds-button slds-button--neutral" value="Cancel" action="{!closePageCDFContact}"/>
                        </div>&nbsp;&nbsp;


 <apex:dataTable Some Datatable logic
                        </apex:dataTable>
                    </apex:outputPanel>

<apex:commandButton styleClass="slds-button slds-button--neutral" onclick="appendEmailIds(); return false;" value="Save" status="busy"/>

JS function called from commandbutton

function appendEmailIds(){

            appenEmailIds();

}

Controller :

public pageReference appenEmailIds(){

    //Some logic

    step1 = true;
    step2 = false;
    step3 = false;
    step4  = false;
    userMap = new Map<String, User>();
    getUserOptions();
    prepareJSON();
    return null;
}

My requirement is to go back to the same VF Page without refresh . Please help.

  • go back means? you just want to stay on that page without refresh right? – patelkiran3090 May 10 at 12:44
  • As in the outputpanel should go away and the previous form should come back. – SFDCRookie May 10 at 12:53
0

Don't you need an action function between the backend apex and the javascript call ie.

<apex:actionFunction name="appenEmailIds" action="{!appenEmailIds}" rerender"sectiontoDraw"/>

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.