Monday, August 20, 2007

Monday, August 13, 2007

Model-Glue Gotcha - Bug or Feature?

I just ran into an interesting issue while developing with Model-Glue. It took a couple of minutes to figure out so here is a quick reminder for both myself and anybody else using Model-Glue. The scenario: You are using multiple views to build your application template. This means that your template itself is composed of several views such as "reportsMenu", "applcationMenu", etc. The actual template file is defined as follows in the template event:
<include name="template" template="dspApplicationTemplate.cfm" />
To include the "applicationMenu" you do
somewhere in your dspApplicationTemplate.cfm The gotcha: The included view has to have <cfoutput> around the html even if there is no CF code to be ran. The complete event definition:
<event-handler name="applicationTemplate">
   <message name="GetUsersWorkOrderTypes" />

   <include name="lookupWorkOrderForm" template="frmLookupWorkOrder.cfm" />
   <include name="reportsMenu" template="dspReportsMenu.cfm" />
   <include name="applicationMenu" template="dspApplicationMenu.cfm" />
   <include name="template" template="dspApplicationTemplate.cfm" />
The "applicationMenu" view(dspApplicationMenu.cfm) iteself included the "lookupWorkOrderForm" and "reportsMenu". Unless I surrounded the html in the "reportsMenu" view (dspApplicationMenu.cfm) with <cfoutput>, it kept showing as an empty string.

Friday, August 03, 2007

Web Developer Toolbar - View Color Information

While trying to figure out what color the "Loading" indicator in Gmail uses, I was fooling around with the Web Developer extension. So I found out that you can get all the colors used on a page by going to "Information" and click on "View Color Information". Click on it will open a new tab with all the colors used on the page you are looking at. Try it for yourself, it's pretty nice. The extension has about a million other options too.

How to Use Model-Glue Generic List

This not new information by any means. However, I always seem to forget how to do this so I have to dig through existing projects to find it. It's pretty damn useful so here it is:
<message name="modelglue.genericlist">
    <!-- Any criteria for filtering the returned query (such as UserName=boyan) -->
    <argument name="criteria" value="" />
    <!-- The name of the table in the database -->
    <argument name="object" value="Users" />
    <!-- The query name to store the results -->
    <argument name="queryName" value="usersList" />
    <!-- Optional: use a custom query GetExistingUsersList from the UsersGatewayMSSQL gateway -->
    <argument name="gatewayMethod" value="GetExistingUsersList" />
// //]]>