• Dana Barnett 12
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

Hi,

 

I have this actionFunction:

 

<apex:actionFunction action="{!addStuff}" name="addStuffJS"> <apex:param name="firstParam" assignTo="{!xAdded}" value="" /> <apex:param name="secondParam" assignTo="{!yAdded}" value="" /> <apex:param name="thirdParam" assignTo="{!zAdded}" value="" /> </apex:actionFunction>

 and in the controller there is:

 

public String xAdded { get; set; } public String yAdded { get; set; } public String zAdded { get; set; } public void addStuff() { system.debug('added x: ' + xAdded); }

 

 

 The actionFunction is called from a JS script which itself is invoked after some button is pressed like so:

 

function btnActionJS() { for (var i=0; i < thisArray.size(); i++) { addStuffJS(thisArray[i]x, thisArray[i].y, thisArray[i].z); } }

 

The issue is that the values for xAdded, yAdded, and zAdded on the controller are all null when the button on the page is pressed (the debug statement on addStuff() prints null). Am I doing something wrong somewhere?!

 

Thanks.

 

 

  • January 20, 2010
  • Like
  • 0