Simple loading of a view

Hi there,

First I want to mention that I've been coding with Fusebox for many
years and now trying our Coldbox. That said, I'm stumped with a simple
loading of a view in another handler. When I load the view in the
"general.cfc" it works fine, but loading it in my own test.cfc fails
with an error message of "N/A" :frowning:

Here is the code:

WORKING:

<a href="##" onclick="$('##thisdiv').load('#event.buildlink('general.mylink')#');">Test
link with jQuery</a>

<!--- ************************************************************* --->
  <cffunction name="mylink" access="public" output="false">
    <cfargument name="event">
    <cfset event.setView("test",nolayout=true)>
  </cffunction>

FAILING:

<a href="##" onclick="$('##thisdiv').load('#event.buildlink('test.mylink')#');">Test
link with jQuery</a>

test.cfc:

<cfcomponent name="test" extends="coldbox.system.EventHandler">

  <!--- ************************************************************* --->
  <cffunction name="mylink" access="public" output="false">
    <cfargument name="event">
    <cfset event.setView("test",nolayout=true)>
  </cffunction>

</cfcomponent>

Di I have to tell Coldbox that I have an additional handler called
"test" (I thought it works by convention?). Or how do I get this
simple example working?

Thanks.

Kind Regards,
Nitai

Do you have handler caching set to false and autohandlersreload set to true in your coldbox config file?

Nolan Dubeau

Load *.*,8,1

ColdFusion won’t allow you to mix named arguments and positional arguments in a method call. Instead of:

<cfset event.setView(“test”,nolayout=true)>

try:

<cfset event.setView(name=“test”,nolayout=true)>

Yes, got;

handlerCaching = false,
eventCaching = false

Do you mean by "autohandlersreload" the param
"handlersIndexAutoReload" ? If so, it is set to "true".

Thanks.

Bingo, you are the man!

I swear I tried about every variation. Once should simply step back,
take a walk and return with a fresh head :slight_smile:

Thanks.

COOLIO!!

Let us know if you need any help.

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