how to pass arguments to an event with the coldboxproxy?

Hi all,

Just a quick question.

Inside the coldboxproxy I believe you can call and return public (none
remote) event like so....

<cfset arguments["event"] = "dashboard.gridCall">
<cfset campaigns = super.process(argumentCollection=arguments)>

this works perfect, however....

If I wish to pass a few arguments to this event how would this be
done?
for example I have tried the following which i assumed would work but
I got an error.

<cfset arguments["event"] = "dashboard.gridCall?sort=#sortrow#">
<cfset campaigns = super.process(argumentCollection=arguments)>

Thanks in advanced.

Glyn

glyn

The process() method takes in the argumentcollection. Put all the arguments you wish to pass via the arguments. So if you wanted to pass two arguments:

<cfset arguments[“event”] = “dashboard.gridCall”>
<cfset arguments[“var1”] = “MyVariable”>
<cfset arguments[“var2”] = "My Variable 2>

<cfset campaigns = super.process(argumentCollection=arguments)>

That’s it, it basically proxies the request to the dashboard.gridCall event with all the variables collected into the request context. Internally in your events, they just are a normal coldbox request where you interact with the request context.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

I did try that but the arguments are not passed. I tried this...

proxy

    <cfset arguments["event"] = "dashboard.gridCall">
    <cfset arguments["sortColumn"] = "#sortColumn#">
    <cfset arguments["sort"] = "#sort#">
    <cfset results = super.process(argumentCollection=arguments)>

and in dashboard.gridCall event

  any function gridCall (required string sortColumn,required int sort)
output=false{
    var rc = event.getCollection();//get scope
    var objORMUsers = EntityLoad("Campaign",{},"#arguments.sortColumn#
#arguments.sort#");
    return objORMUsers;
    event.noRender();
  }

message: Error invoking CFC /proxyCB.cfc : The SORTCOLUMN parameter to
the gridCall function is required but was not passed in

did i miss something here?

yes,

They are not passed as event handler arguments. They are added to the request collection, this way it is the same way to develop mvc or remote applications.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com