[coldbox 3.8.1] defaultView setting in custom module

16 views
Skip to first unread message

slawek.m...@akitogo.com

unread,
Jul 21, 2015, 8:54:58 AM7/21/15
to col...@googlegroups.com
Hello everyone!

Firstly I would like to say a warm "hi" to the community, I have just recently started my exciting adventure with coldbox, and it's my first time on this group. Please be patient with me :-)

To the point: I created a new module and I am having problems setting the "defaultView" option in the layoutSettings struct inside my module configuration:

ModuleConfig.cfc:
        layoutSettings = {
            defaultLayout
= "mainlayout.cfm",
            defaultView
= "test_view.cfm"
       
};

When I reload the page, I get an error:
Application Execution Exception
Error Type: missinginclude : 0
Error Messages: Page //views/default/index.cfm [C:\(...)\slawek_contentbox\views\default\index.cfm] not found

The weird thing is that the defaultLayout setting works correctly and loads my layout (mainlayout.cfm).

What is interesting, if I check in my handler for event.getDefaultLayout() or event.getDefaultView() they both return the main application default values set in Coldbox.cfc

If I set the view inside my handler (default.index) using event.setView(view="test_view"), the view is rendered correctly. If I set the default view inside the handler using event.setDefaultView("test_view") it works correctly too.

It seems that only the defaultLayout setting overwrites the main coldbox settings but not the defaultView.

Would someone be so kind to check if this functionality works for them?

best regards,
Slawek

Brad Wood

unread,
Jul 22, 2015, 12:23:31 PM7/22/15
to ColdBox Platform, slawek.m...@akitogo.com
Hi Slawek and welcome to Boxlandia!  I don't know the answer to your question right off and I haven't the time at the moment to give it a test.  I pinged Luis to see if he can help.  In the mean time, don't be afraid to bump your thread in a day or so if no one replies.  Sometimes it gets lost in the inbox :)

Thanks!

~Brad

Luis Majano

unread,
Jul 22, 2015, 2:17:38 PM7/22/15
to ColdBox Platform
Slawek,

Unfortunately, a default view on a per module basis does not work. I guess we never completed that.  I would encourage you to fill out an issue for it and we will address it. Or if you feel right for the challenge, you can submit a pull request :)


On Tuesday, July 21, 2015 at 7:54:58 AM UTC-5, slawek.m...@akitogo.com wrote:

br...@bradwood.com

unread,
Jul 22, 2015, 2:18:47 PM7/22/15
to col...@googlegroups.com
 
Thanks!

~Brad

ColdBox Platform Evangelist
Ortus Solutions, Corp

E-mail: br...@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com 
 
 
--------- Original Message ---------
Subject: [coldbox:24708] Re: [coldbox 3.8.1] defaultView setting in custom module
From: "Luis Majano" <lma...@ortussolutions.com>
Date: 7/22/15 1:04 pm
To: "ColdBox Platform" <col...@googlegroups.com>

Slawek,

Unfortunately, a default view on a per module basis does not work. I guess we never completed that.  I would encourage you to fill out an issue for it and we will address it. Or if you feel right for the challenge, you can submit a pull request :)

On Tuesday, July 21, 2015 at 7:54:58 AM UTC-5, slawek.m...@akitogo.com wrote:
Hello everyone!

Firstly I would like to say a warm "hi" to the community, I have just recently started my exciting adventure with coldbox, and it's my first time on this group. Please be patient with me :-)

To the point: I created a new module and I am having problems setting the "defaultView" option in the layoutSettings struct inside my module configuration:

ModuleConfig.cfc:
        layoutSettings ={
            defaultLayout
="mainlayout.cfm",
            defaultView
="test_view.cfm"
       
};

When I reload the page, I get an error:
ApplicationExecutionException
ErrorType: missinginclude :0
ErrorMessages:Page//views/default/index.cfm [C:\(...)\slawek_contentbox\views\default\index.cfm] not found

The weird thing is that the defaultLayout setting works correctly and loads my layout (mainlayout.cfm).

What is interesting, if I check in my handler for event.getDefaultLayout() or event.getDefaultView() they both return the main application default values set in Coldbox.cfc

If I set the view inside my handler (default.index) using event.setView(view="test_view"), the view is rendered correctly. If I set the default view inside the handler using event.setDefaultView("test_view") it works correctly too.

It seems that only the defaultLayout setting overwrites the main coldbox settings but not the defaultView.

Would someone be so kind to check if this functionality works for them?

best regards,
Slawek

 

--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/7395cac7-bae2-4ba0-8ec1-8d25e007e062%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages