event.noLayout() not taking effect from interceptor

I have an interceptor that executes at the proper point (I can dump and abort from the interceptor) but the event.noLayout() I have in method isn’t running:

any function preRender(event,interceptData){

event.noLayout();

}

I can do:

any function preRender(event,interceptData){

writeDump(‘I see this’);abort;
event.noLayout();

}

I see the dump fine, so my interceptor runs, but when I just have the noLayout() the layout still renders. I have tried this on both defined and implicit views where there is no layout set in the action.

If I set event.noLayout() in the action the layout does not render.

Any ideas?

Because that’s too late in the request lifecycle. preRender runs AFTER the view and layout have already been executed, but not “rendered” to the browser. You’ll need to use an interception point that earlier in the flow.

Definition of preRender from the docs:
This occurs after the layout+view is rendered and this event receives the produced content

http://wiki.coldbox.org/wiki/Interceptors.cfm#Layout-View_Events

The diagrams here should help:

http://wiki.coldbox.org/wiki/RequestLifecycles.cfm

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Thanks! It was working in 3.8, must have been a fluke or has this changed?

I can’t imagine how it would have worked in 3.8. The preRender interception point always received the full rendered HTML of the view and they layout which meant both had already been processed.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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