I click on the buttom (a commandlink), which calls the js function save() and then calls the actionfunction afterValidation(), which is supposed to save the param value to the controller and then take you to the next page. It takes me to the next page fine, but the param value never gets passed


function save() {
  // validate everything is okay


<apex:form >
        <apex:commandLink styleClass="slds-button slds-button--brand" onclick="save();return false;">
          <svg aria-hidden="true" class="slds-button__icon slds-button__icon--right">
            <use xlink:href="{!URLFOR($Resource.lightning, '/assets/icons/utility-sprite/svg/symbols.svg#forward')}"></use>
        <apex:actionFunction name="afterValidation" action="{!next}">
          <apex:param name="test" value="abc" assignTo="{!test2}"/>


public String test2 {get;set;}
public PageReference next() { // takes you to the next page...works as expected}

But every time I debug "test2", I get "null" instead of "abc"

  • wen do u get null in debug ? in your next method before moving to the next page ? or when you try accessing test2 in the next page methods ? Nov 29, 2015 at 19:45

3 Answers 3


I think the reason is because your apex:Param is child of second actionFunction, rather than first one.


This is a weird known issue. You need to add a reRender attribute in your actionFunction tag to make apex:param work(sometimes).

<apex:actionFunction name="afterValidation" action="{!next}" reRender=""> 
<apex:param name="testParam" assignTo="{!test2}" value="abc" />

You may want to vote this idea


Give the apex:param a "name" property. Any name. It's weird bug.

<apex:param name="test" value="abc" name="aaa" assignTo="{!test2}"/>

You must log in to answer this question.

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