coldbox[3.5] Interceptor after each page is clicked

Hi Guys

Is there a way I can create an interceptor which will show please wait message upon calling the new page.

Thank you

having never done this, use cfflush on preProcess(). maybe contain that cfflush in your applicationhelper.

Try cfflush but it does not seems to work . What I trying to do on preProcess display a dialog jquery message please wait

how does it not seem to work? i would think sending script tags & javascript back to the browser to display the message would be how to do it.

what i would do instead, depending on what youre fetching, is to do all of it via js/ajax.

I am getting an error message
You have called cfflush in an invalid location, such as inside a cfquery or cfthread or between a CFML custom tag start and end tag.

Did you figure this out. I’m trying to do the same thing.

If you want to display messages on the front end of your website from the bowels of your code, please look at the message box plugin. It stores the messages in flash RAM until the next time you call #getPlugin( “messageBox” ).renderIt()#. I usually put that output in my layouts so each page will output whatever messages there are.

Trying to output any sort of JavaScript or HTML directly from inside an interceptor or model is an incorrect approach. The view (layouts are part of the MVC “view”) should retrieve any output code from the appropriate model object (like the MessageBox plugin) as necessary. Don’t just try to flush content into CF’s output buffer from your models.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Brad, as much as I agree with you, ContentBox breaks those rules well and truly.

What Brad is actually trying to say is that for what your doing it is the wrong approach, you can use an interception (custom) point to add JS or CSS to enhance the layout of the site. However to have an interaction like this can’t happen because of the way the code is segregated between client and server code.

Show me an example of HTML being put directly into CF’s output buffer from a model. Everything I’ve seen is strings of HTML being concatenated and returned.

Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

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

Brad,

Its the perception of what you said.

"Trying to output any sort of JavaScript or HTML directly from inside an interceptor or model is an incorrect approach. "

If we go back to the original question, it never asks about cfflsuh or CF output buffer, but using cfflush or CF output buffer in ColdBox is never going to happen anyway, which you are right on. But that doesn’t mean interceptors can’t be used to inject CSS or JS into a view or layout, it just means one is restricted on how to go about it.