JavaScript Remoting and Skuid

edited May 8, 2019 in Questions
What is the proper pattern for using JavaScript Remoting i.e. @RemoteAction from a Skuid inline JavaScript resource?

Google-Bing led me to this article:
http://sowjitechblog.blogspot.com/2014/05/visualforce-make-remote-action-call.html

Any guidance or code snippets would be appreciated.

Regards,
Irvin

Comments

  • edited March 2, 2017
    The approach documented under "From a Static Resource" in that article is the proper way to go.

    For instance, if your VF Page's Apex Controller is called "TurboThrusters" and it defines a RemoteAction named "Engage" that expects a single number argument, then your JavaScript would call it like this:

    var thursterPower = 50;

    TurboThrusters.Engage(thrusterPower,function(result,event){
       if (event.status) {
           console.log('Got response back from server okay');
          console.log(result);
       }
    });


  • edited May 8, 2019
    Alright, that's the way I will go.  Thanks!
  • edited March 2, 2017
    Also keep in mind that if your code is in a managed package, then you will need to use the Namespace Prefix of that managed package. For instance if your namespace is "galactic", then you would need to do this:

    galactic.TurboThrusters.Engage(thrusterPower,function(result,event){
       if (event.status) {
           console.log('Got response back from server okay');
          console.log(result);
       }
    });
  • edited May 8, 2019
    Thanks.  You probably just saved me a few minutes of wailing-n-gnashing.
  • edited May 8, 2019
    Worked out great.  Thanks again.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!