[coldbox 3.7.0] setNextEvent with handler packages

I’m starting to setup packages in my handlers folder and am running into a number of issues… Most I have been able to get around, but this one I can’t seem to resolve.

How do I redirect to a handler in a package with setNextEvent()?

For example:

`
setNextEvent(‘settings.profileeventtypes/edit’);
setNextEvent(‘settings/profileeventtypes/edit’);
setNextEvent(‘settings.profileeventtypes.edit’);

`

all result in error:

The event: profileeventtypes.edit is not valid registered event.

How do I reference a package with setNextEvent? Can it be done?

Many Thanks

Jason

it would be the third one.

so your handler structure would look like /handlers/settings/profileeventtypes.cfc. the cfc will contain a method called ‘edit’. make sure its a public function.

Thanks Aaron… not working for me…

`
setNextEvent(‘settings.profileeventtypes.edit’);

`

This just redirects to /settings/profileeventtypes/edit, but needs to resolve to /settings.profileeventtypes/edit

I have found that this works… not idea, but only thing I have been able to get working:

`
setNextEvent(url=’/index.cfm/admin/settings.profileeventtypes/list’);

`

Wait, does the actual name of your handler or package have a period in it? If so, I’m pretty sure that will cause you issues. Also, when you specified a straight URL, you had /admin/ in there. Is that a handler? Package?

Can you show us the full directory structure starting from your web root?

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

Hi Brad. No, no period in the handler name… it’s package.handler.

  • admin: module
  • settings: package
  • profileeventtyps: handler
  • edit: method

Full directory structure from root is to handler is:

[root]/modules/admin/handlers/settings/profileeventtypes.cfc

Ahh, I see. Unless you’ve created special routes, the module entryPoint will need to be in there.

I believe it should be:

admin.settings.profileeventtyps.edit

Assuming that the entryPoint in your module config is “admin”

Here’s the docs:
http://wiki.coldbox.org/wiki/URLMappings.cfm#Routing_By_Convention

// If 'admin' is a package in the handlers directory
http://localhost/admin/general/index -> event=admin.general.index 
// If 'admin' is a module
http://localhost/admin/general/index/id/4/page/2 -> event=admin:general.index&id=4&page=2

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com

I believe it should be:

admin.settings.profileeventtyps.edit

admin:settings.profileeventtyps.edit