I want to call an Ajax function by using remoteFunction. But I'd like to set controller and action names with JS variables. Like this:
...
var id = 1;
for (var i = 0; i < updater.slaves.length; i++) {
var slave = updater.slaves[i];
var ctrl = slave.data.controller;
var action = slave.data.action;
${remoteFunction(controller: ctrl, action: action, params: "'id=' + id", onSuccess: "onSuccessLoadApplications(arguments)", onFailure: "error(arguments)")}
}
The problem is I can't retrieve the ctrl and action values (it's ok for id var).
So, is it possible to make dynamic controller and action args for remoteFunction ?
Thanks.