Luis Majano Forums Notification: Post to Automatically include views?

Title: RE: Automatically include views?
Thread: Automatically include views?
Forum: Need Help?
Conference: ColdBox
User: lmajano

Adam,

"From the look of things if there is no view included in the handler
then coldbox will throw an error as of now. I wonder if it would be possible for
it not to throw an error at this point, and then include that view at a later
time?"

You can do that. Remember that the final step in execution is the
rendering of the page. So you can have a thousand events fire before that that
could be changing the event, views, and layouts. The only requirement is that at
the end, there should either be a view to render or the event has relocated to
another request.

When you say: "if no view is explicitly rendered in the
user.home" Are you rendering the view there and placing it in a content
variable? or you just mean using the
"Context.setView("view")" method??

A good example would be
using the postHandler (I know its still not out, but you can actually get it
from the SVN repo. I will be posting the latest 2.0 this week). You can execute
user.home, and then the posthandler will execute and you can parse the request
context there and change things around. Now, without the post handler, then it
gets tricky, because you will have to explicitly call another event via the
runEvent() method. Such as at the end of the user.home handler.

<cfset
runEvent("user.parser")>
or
<cfset parser(requestContext)>
if the parser method is inside the same handler.

I think the best solution is
the "postHandler", so just get the latest build from the SVN and test
it out. I will try and get the build together for downloading.

http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=272B932C-123F-6116-42827CF2D6C2A6E7