How prevent page rerendered on ?

I’m using <apex:actionFunction> and my page is reloaded. I don’t use reRender attribute and I’m wondering if there is a way to prevent page reloading.

Maybe there is a special value to set to reRender ?


Here is my code :

  <apex:page controller="myController">
      <apex:commandButton value="save" onclick="save()"/>

      <script type="text/javascript">

          function save(){
              // Some code
              // Some code

      <apex:form >
          <apex:messages />
          <apex:actionFunction name="myMethod" action="{!controllerMethod}">       
              <apex:param name="param" value="" />

And my controller :

 public String controllerMethod() {
     String values = Apexpages.currentPage().getParameters().get('param');
     system.debug('Values : ' + values);

     return values;


If you call the action function just put return false; to the end of the call:

<apex:actionFunction name="myFunction" action="{!someMethod}" /> 

<a href="#" onclick="myFunction(); return false;">Click me</a>

Or based on your code:

<apex:commandButton value="save" onclick="save(); return false;"/>

Source : Link , Question Author : SF_user , Answer Author : Sergej Utko

Leave a Comment