Monday, February 1, 2010

Finding Coldfusion Components

So I have been having this issue where Coldfusion cannot seem to find my components. In my Application I have this:

this.mappings['_extensions'] = GetDirectoryFromPath(GetCurrentTemplatePath()) & "_extensions\_components";

And that did not seem to work. The one thing I have found that works was to setup a Custom Tag path in the administrator pointing to my extensions directory. If anyone has any thoughts, please let me know!

Thursday, May 8, 2008

Javascript Multi-Line Alert Message

So I like using this code snippet when doing Javascript validation.

var Message = "";

if(Message == "")
Message = 'Please enter a valid value.';
Message = Message+ '\nPlease enter a valid value.';

This snippet makes for a nice one alert at the end of the validation function. So if you are validating multiple form fields you don't need one alert for each failed validation where you can use one alert. I borrowed the idea from Coldfusion validation. At the end I do a:

if(Message != ""){
return false;

Friday, April 18, 2008

Javascript and Me. (Rant)

I have realized that Javascript will eventually be the death of me. I mean, I love it when it works but hate it when it doesn't work. You know? It is fascinating for what it can do but seems quirky to me that with using different browsers some of the functionality is lost. Like for instance removeNode() works fine in IE 7 but doesn't work in Firefox. What is the deal with that? Can't we have a browser that everything works just fine in? I am sick of having to code around one browser not being able to handle something that the other browser can handle. You think the 2 biggest browsers would be compatible between the two, at least for the most part.

Oh well.

Ahhh Ryan.

CF Snippets.

So I thought I would write about CF Snippets inside CFEclipse. No one is really using it but I thought I would share how to set it up just incase someone reads this and doesn't remember or know how to set it up.

First thing to do is make sure you have the latest version of Eclipse, version 3.3. CFSnippets has been in older versions of Eclipse but in this version they introduce the Snipex server and lets us share our snippets to the community. After that make sure you have the CFEclipse plugin installed on your Eclipse software.

Once you have CFEclipse installed you should see a Snip Tree View on the left side of the screen. If not you can go to Window>Show View>Snip Tree View. Inside this view you can create the snippets. I start off by creating a package:

Then inside the package you can right click the package and select "Create Snippet". Once you select that you will be prompted with this window:

Basically all you need to do is give the snippet a name.

Trigger text is neat because you can give it a custom word and when you type that word in your editor and press CTRL+J it will insert your snippet into the editor in place of the trigger text.

Description is optional, but the description can be helpful when you can't remember what the snippet actually does.

Now for the starting and end block. I usually only worry about the start block and forget about the end block. The end block is nice when you have a closing tag and you want to place something inside the block of code. Otherwise I use just the start block. You can basically place any sort of code inside the block and it will fill place the snippet where ever your cursor is placed. Some good techniques to remember would be user interaction with the snippet. Using "$${Variable Name}" Variable Name can be anything but when using this in your snippet will pop up a window and Variable name is the label for your text box for the user to input. So a helpful label is always nice. Also you can reuse that block in other places in your snippet and it will only ask for input once for that variable. You can also do "$${Option|Option|Option}" and it will be a select drop down instead of a text box.

Well that's it. Hope this helps I will post again about publishing and setting up a Snipex server.

Ahhh Ryan.

Thursday, April 17, 2008

As promised here is a picture of Dave's map. Isn't it wonderful?

Ahhh Ryan.

First blog entry.

This is my first entry. Blogs are trendy and I feel trendy. So I decided to post a trendy first entry post aswell.

AHHH Ryan.