One of the problems I looked into this week was why some items on our site that used to be in bold were no longer displaying as such. Viewing the source showed me that the text was indeed surrounded by <strong> tags.
Using the awesome Firebug extension for Firefox, I could see that the ext-all.css file was disabling the font-weight on the strong tag. This was quite surprising to me!
The ext-all.css file will automatically be included on your page whenever you use almost any of the UI features such as cfgrid, cflayout, etc.
You can easily reproduce the problem with this minimal code:
<cflayout type="tab"></cflayout>
<strong>This should be bold but its not.</strong>
You can fix the problem by adding this to your site’s style sheet, if you have one:
strong { font-weight: bold; }
If you don’t use a separate style sheet you can just put it directly into your page like this:
<style type="text/css">
strong { font-weight: bold; }
</style>
Hopefully this can be fixed before 9.01 comes out. I think its a pretty big deal, it disabled tons of bold content on our site. A lot of our content is created using the FCK rich text editor, which uses strong tags to indicate bold. I’ve file a bug report with Adobe, you can vote for this bug here: http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#bugId=82156
After looking through the EXT documentation, I think this css originates with the EXT group. But when Adobe repackages EXT into CF, they need to either override this style it or take it out of the css file completely.
Posted by Ryan Stille on February 19 2010 at 8:45 pm under CSS, ColdFusion.
Comment on this post.
A few weeks ago, the people at CFWheels announced a contest to get people to try out CFWheels. To enter the contest all you need to do is build a version of litepost in CFWheels. If you haven’t heard of litepost, its a simple blogging app thats been used to demonstrate different ColdFusion frameworks. Really all you need from the litepost project is the database. Then just build some CRUD for the users, entries, comments, etc. I’ve been wanting to learn more about this framework for a while so I thought this contest would be a good excuse to check it out. The top 3 winners get Amazon gift cards.
So far I’ve found this to be a pretty neat framework. I see a lot of similarity to Rails. The documentation is very good. The plugins are pretty neat, you just drop a zip file into your plugins directory and you can start using that plugin.
To start I downloaded cfwheels and setup my database. I installed the scaffolding plugin and used that to generate my CRUD views, models and controllers. Already I had the basics working! I tried creating/listing/editing users and it worked great.
Continue reading ‘Trying out the CFWheels framework’ »
Posted by Ryan Stille on February 13 2010 at 11:26 pm under ColdFusion, Web Development.
6 Comments.
A while back I wrote a post explaining how to wrap the tabs generated by the new cflayout tab in ColdFusion 8.
The tabs generated by ColdFusion 9 are completely different, since they use Ext version 3. ColdFusion 8 used Ext 1.
The tabs in ColdFusion 9 do not wrap by default, but they do automatically add scroll controls so you can scroll through the long horizontal line of tabs. If you’d rather have them wrap into multiple lines, this little bit of CSS will do it:
.x-tab-panel ul.x-tab-strip {
width: auto !important;
}
Posted by Ryan Stille on January 23 2010 at 9:16 pm under CSS, ColdFusion.
Comment on this post.
I just found out I was accepted into the Adobe Community Professionals program for 2010. I hope I can be a good resource for the ColdFusion community. I look forward to continuing to blog and discuss ColdFusion. The CfObjective conference in Minneapolis is just a few months away. I’ll be there, come say hello if you see me.
Here is the announcement http://lizfrederick.blogspot.com/2010/01/new-acps-for-2010.html
Posted by Ryan Stille on January 18 2010 at 8:54 pm under ColdFusion.
2 Comments.
One of the things I’ve noticed as I’ve been working on our ColdFusion 9 upgrade is that many of the UI components look different than they did in ColdFusion 8. In many cases I’m sure this won’t be a problem. But my user base is fairly picky, and I think the CF8 to CF9 transition should be seamless to them. The tabs in CF9 look quite a bit different than they do in CF8.
Given this bit of code:
<cflayout name="tabtest" type="tab">
<cflayoutarea name="tab1" title="tab one">
<p>this is tab number one.</p>
</cflayoutarea>
<cflayoutarea name="tab2" title="tab two">
<p>And here is tab two.</p>
</cflayoutarea>
</cflayout>
ColdFusion 8 generates a set of tabs that look like this:

Here is what that same code generates in ColdFusion 9.

This is quite a bit different, and in our early user testing they liked the old look better. So I came up with this CSS:
div.x-tab-panel-header, ul.x-tab-strip-top {
background-image: none;
background-color: transparent;
padding-bottom: 0px;
}
div.x-tab-panel-header {
border: 0px;
}
With that applied, the ColdFusion9 tabs come out like this:

I still don’t like that in CF9 the tabs jump around as you select different tabs. This happens because the current selected tab is indicated by a bold label. The bold text takes up more room, so as you select different tabs everything gets shifted around. This is especially odd when you are wrapping tabs – sometimes the wrap point changes when switching between tabs, so a whole tab will jump from one line to another. I think this could be fixed, too, if you came up with a different way to indicate the current tab. If someone figures this out and wants to send it to me I’d appreciate it.
Posted by Ryan Stille on January 16 2010 at 10:12 pm under CSS, ColdFusion.
2 Comments.
A friend asked me for some help the other day. At the place he works at they use IIS on their production servers, but each developer works locally using Apache. Why use different webservers for production and development? He said they do it because its easier to develop locally with Apache. My guess is its easier because you can run multiple sites at once with Apache. With IIS on a desktop machine you can only run one site at a time. I do the exact same thing at my job, actually.
Anyway, once in a while this causes issues. In this case, there was code on the server that required a username and password in order to access the page. The security was done at the web server level, aka “HTTP authentication”, which causes your browser to prompt you for a username and password. These credentials then get sent along in the request headers (its actually a little more complicated than that but I won’t get into that here). After authenticating, the username is available to ColdFusion as a CGI variable – CGI.REMOTE_USER.
When using IIS, that value is also available as CGI.AUTH_USER. In all CGI variable specs I could find, they all reference REMOTE_USER, not AUTH_USER, I’m not sure when AUTH_USER started to be used. Anyway, this ColdFusion code running on the IIS server would look to the CGI.AUTH_USER variable and display some things differently depending on who the user was.
This posed a problem when trying to run this code locally under apache. The CGI.AUTH_USER variable did exist, but it was always blank. One could change the code to use the more multi-platform friendly “REMOTE_USER”, but sometimes there are hurdles to changing existing code.
But there is a way to mimic the behavior of IIS, by copying the REMOTE_USER value into AUTH_USER. Its only three simple lines but it took me quite a while to figure this out.
RewriteEngine on
RewriteCond %{REMOTE_USER} (.*)
RewriteRule .* - [E=AUTH_USER:%1]
You’ll need to have mod_rewrite enabled of course. Usually all you need to do is uncomment a line that looks like this in httpd.conf:
LoadModule rewrite_module modules/mod_rewrite.so
The three magic lines can go into the httpd.conf file, or you could place them in a .htaccess file in the directory you’re working in.
Posted by Ryan Stille on January 9 2010 at 3:50 pm under ColdFusion, Linux, Web Development.
2 Comments.
I had an issue recently when I was working with a couple other developers on a project. We keep our MySQL database in sync by exporting the database as an SQL script and sharing it in a subversion repository (I wish MS SQL could be this easy!). Our table names are saved with mix case, like “userFiles”, but everytime I would export my database the tables would come out all lower case, like “userfiles”.
Turns out this is a simple thing to fix, I had to add a line to MySQL’s config file: my.cnf. Mine was located at [MySQL installed root]\bin\my.cnf. The setting that needs to change is lower_case_table_names, I set the value to 2, like this:
lower_case_table_names=2
If you are interested, here are the different possible values:
| Value |
Meaning |
| 0 |
Table and database names are stored on disk using the lettercase
specified in the CREATE TABLE or CREATE DATABASE statement. Name comparisons are case
sensitive. Note that if you force this variable to 0 with –lower-case-table-names=0
on a case-insensitive file system and access MyISAM tablenames using different
lettercases, index corruption may result. |
| 1 |
Table names are stored in lowercase on disk and name comparisons are not
case sensitive. MySQL converts all table names to
lowercase on storage and lookup. This behavior also
applies to database names and table aliases. |
| 2 |
Table and database names are stored on disk using the lettercase
specified in the CREATE TABLE or CREATE DATABASE statement, but MySQL converts them to
lowercase on lookup. Name comparisons are not case sensitive. This works only on file
systems that are not case sensitive! InnoDB table names are stored in
lowercase, as for lower_case_table_names=1. |
On Windows the default is 1.
More information at http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html
Posted by Ryan Stille on January 3 2010 at 11:24 am under SQL, System Administration.
1 Comment.
Today a coworker asked me if I knew how to recover a deleted file in CFEclipse. He had accidentally deleted it before putting into his source control. Since he had been working on this file recently, there is a way to recover it.
By default Eclipse keeps a local history of the files you work on. From within Eclipse, right click on a file and select Team->Show Local History.

From here you will get a list of revisions, generally one is made each time you save the file. You can open a revision, or even use a built in diff tool to compare it to your current version.

But in this case we had no current version to even right click on to start the process. So we simply created a new, empty file in the same location as the old one. Then we were able to right click on it and pull up the history.
This local history is stored under your workspace in workspace\.metadata\.plugins\org.eclipse.core.resources\.history, but its not easy to manually browse. There any many directories and the files in those directories are given nonsense file names. Much easier to stick with the Eclipse interface.
Keep in mind that if you haven’t edited the file in a while there may not be any history to go to.
Posted by Ryan Stille on December 16 2009 at 10:25 pm under ColdFusion, Web Development.
1 Comment.
The other day I had the need to align some data in an html cfgrid. There are some alignment attributes of the cfgriditem tag, but they do not work in html grids. I tried wrapping the data in a span tag with some css aligning it, but that didn’t work either.
But there is a way. When CF8 generates the grid it writes out CSS ids and classes that you can use to style the grid. For example to right align the 5th column you can use this:
.x-grid-td-5 {text-align:right;}
The number you need to use in the class name does not always match up with the column. Sometimes I had to use .x-grid-td-8 to reference the 6th column for example. I think the number increments for each cfgrid item, even if you have display=no.
If you have more than one cfgrid on your page and only want to align the nth column in one of them, you can wrap the cfgird in a div with an ID so you can reference only that grid in your CSS.
Posted by Ryan Stille on September 27 2009 at 9:35 pm under ColdFusion, Uncategorized, Web Development.
1 Comment.
I just discovered a neat feature of CF9. Sometimes when calling a built in function or even a custom method, you get returned an array. But sometimes you only need one element in that array. In Perl and other languages its possible to directly access the element you want. I’m glad to see this has been added to ColdFusion9.
For example, lets say you need the second particular element in an XML document. You might fetch some XML with cffeed and then use XMLSearch() to get all the matching elements. Then reference the second element of the resulting array, like this:
Continue reading ‘Referencing returned value array values in CF9’ »
Posted by Ryan Stille on September 14 2009 at 10:06 pm under ColdFusion, Railo, Uncategorized.
Comment on this post.