I have run into a problem with using an event type that leverages a
result to display a view.
I have a default event type that checks one's login status and, based
on that result, either displays a link to login ("website.loginlink")
or a personalized greeting ("website.salutation"). It looks like
this ...
<event-type name="website.defaultevent">
<before>
<broadcasts>
<message name="auth.checkLoginStatus" />
</broadcasts>
<results>
<result name="isLoggedIn" do="website.salutation" />
<result name="notLoggedIn" do="website.loginlink" />
</results>
</before>
<after>
<views>
<include name="title" template="pages/title.cfm" />
<include name="banner" template="pages/banner.cfm">
<value name="xe.home" value="website.home" />
<value name="xe.childcare" value="website.childcare" /
>
</include>
<include name="navbar" template="pages/navbar.cfm">
<value name="xe.home" value="website.home" />
<value name="xe.ourstaff" value="website.ourstaff" />
<value name="xe.ourphilosophy"
value="website.ourphilosophy" />
</include>
<include name="navbar2" template="pages/navbar2.cfm">
<value name="xe.blog" value="blog.home" />
<value name="xe.lunchmenu" value="website.lunchmenu" /
>
<value name="xe.calendar" value="website.calendar" />
<value name="xe.directory" value="website.directory" /
>
</include>
<include name="website" template="templates/website.cfm" /
>
</views>
</after>
</event-type>
The event handlers noted in the results are ...
<event-handler name="website.salutation" type="">
<broadcasts>
<message name="getSalutation" />
</broadcasts>
<views>
<include name="salutation" template="pages/salutation.cfm">
<value name="xe.logout" value="auth.logout" />
</include>
</views>
</event-handler>
<event-handler name="website.loginlink" type="">
<views>
<include name="salutation" template="pages/loginlink.cfm">
<value name="xe.login" value="website.loginform" />
</include>
</views>
</event-handler>
When, as an anonymous site visitor, I run an event (i.e.
"website.home") that is included in an event handlers block that has a
default event type equal to "website.defaultevent", only the view from
the "website.loginlink" event displays in the browser.
<event-handler name="website.home">
<views>
<include name="body" template="pages/home.cfm">
<value name="xe.home" value="website.home" />
<value name="xe.didyouknow" value="website.didyouknow" />
<value name="xe.referafamily" value="website.refer-a-
family" />
<value name="xe.parenttestimonials"
value="website.parenttestimonials" />
<value name="xe.one2onefaq" value="website.one2onefaq" />
</include>
</views>
</event-handler>
If I comment out the results block in the "website.defaultevent" event
type, reinit the app, and refresh the page, then all other views run
as expected and display in the browser.
My question ... How do I use a result in an event type to run another
event that displays a view, and include the view in the called event
handler?
Or maybe better asked, what is the better way to handle this via MG?
garence
--~--~---------~--~----~------------~-------~--~----~
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
-~----------~----~----~----~------~----~------~--~---