What exactly the error message when you tried with dot?
Also check your Coldbox.cfc - handlersExternalLocation, perhaps the handler is not in the default location.
Not sure what’s going on. Based on your sample code, this is how should work:
function test(event, rc, prc) {
setNextEvent(event=“Administration**.**locations”); // Use dot, not slash
}
If you call index.cfm?event=Administration.test from your browser, it will be redirected the page to Administration.locations. By default, implicitly the handler will call the view page, locations.cfm. If you don’t have locations.cfm in your /views/administration folder, then you will get Error Messages: Could not find the included template [path]/views/administration/locations.cfm.
Well yes, I agree with everything you say, that is what should happen. But it doesn’t
To recap, the test() function runs and Coldbox, rather than executing setNextEvent() and relocating like it should, is immediately asking where the /views/Administration/test.cfm template is. And of course there isn’t one.
Note that if I use Sana’s suggestion of: location("#event.buildLink(“Administration.locations”)#", false); the application locates perfectly. Maybe that’s because the native CF function just kicks in and takes over where Coldbox is failing? It’s a guess, but I don’t know.
But I am assuming there must be something in my config that is preventing setNextEvent() from working, but what could it be??
If you’re seeing otherwise, you need to provide us with the full stack trace of the error. It will tell us right away where in the request lifecycle this is happening.
Secondly, can you create a sample application that exhibits this behavior that you can zip up and send for us to try?
Lastly, please consider staying up to date with ColdBox 4.1. ColdBox 3.6.0 is missing 2 years worth of enhancements and bug fixes.
If it is using the default view, then you need to figure out why it is using the default view.
Is Administration a Module and if so check what layout it is using. But for future reference, the setNextEvent() has to be a valid handler that ColdBox understands, if it is not then it will try to load the default layout and view and in this case is probably the source of your issue.
Is Administration a Module…?
It’s just an ordinary controller in the \handlers directory.
the setNextEvent() has to be a valid handler that ColdBox understands…
It seems that Coldbox is currently simply ignoring setNextEvent(). For info, Coldbox is definitely ‘working’ at this point because runEvent() works if I substitute it in. So the question is, why is setNextEvent() apparently not “a valid handler that ColdBox understands”, and how can I make it so? Where do I look? And would it help if I posted the Coldbox.cfc?