Tuesday, March 13, 2007

Issues with DataGrid Column Visibility

A friend of mine passed along an interesting problem regarding DataGrids. They had the need to hide certain columns and then dynamically load the data. When doing this as expected, such as dataGridName.dataProvider = yourArrayName, the hidden columns would not stay hidden. The workaround to this issue is to track the visibility of each DataGridColumn, set the column to visible, and then override it with the visibility status we stored.

View the example here and download the code here.

Definately not optimal, but it works... ;-)

Form Validation

Paul Rangel from Wheeler Street Design put together a simple form validator that works quite well. The only thing that you have to be aware of is the fact that you need to initialize the validators property after your form fields are added if you're using states.

Friday, March 09, 2007

Animator vs Animation

A friend of mine just passed me the following YouTube video. It's a great example of someone who is extremely talented and creative with Flash. It's worth a watch.

Enjoy!

Wednesday, February 21, 2007

Internal Build Error

I recently ran into an issue with Flex Builder where I was getting the "An internal build error has occurred. Please check the Error Log." error when trying to debug my project. Absolutely nothing worked including all the normal practices such as cleaning the project, recreating the workspace, manually deleting the bin folder, reinstalling Flex Builder, etc.

After performing all of these tasks I was still getting "Uncaught exception in compiler" in the error log, which by the way is the .log file in the .metadata folder of your workspace. After further analysis, I tied the issue back to a missing semi-colon after a variable declaration in my class such as:

public class SomeClass
{
      public var blah:Object
}

If you ever find yourself in this situation, start rolling back code and begin to do a detailed analysis for syntax errors that normally do not pose any problems.

Wednesday, February 14, 2007

Flex tree's with a context menu

Recently on the flexcoders list a question was posed regarding how to get the item that was 'right-clicked on' when dealing with a tree. There are a few steps to follow if you plan to implement a context menu that is dynamic based on individual tree items.

First, you need to use the itemRollOver event of the <mx:Tree> component to track the last item that was rolled over, and save it to a variable for later use. Then when the ContextMenuEvent.MENU_SELECT event is triggered, you will refer back to this variable as it holds a reference to the itemRenderer and therefore the data you need access to.

You can view an example here and view the code here...

Updated Flex Style Explorer v2.0.1

I just realized that Adobe Consulting released a new version of the Flex Style Explorer. The style explorer is great if you want to see what you can do with CSS in flex. It's also a good way to start working with styles, although you must keep in mind that this is just the beginning of how you can tweak the look and feel of your flex applications.

http://examples.adobe.com/flex2/consulting/styleexplorer/Flex2StyleExplorer.html

Friday, January 26, 2007

Flex Performance

Brandon Purcell from Adobe put together a great article discussing flex performance and optimization. This articles includes many tips and tricks, along with general best practices to increase client performance.

http://www.adobe.com/devnet/flex/articles/client_perf_print.html

Thursday, January 25, 2007

Where's the problem?

I recently ran into an issue with Flex Builder where the Problems tab wasn't accurately reporting information. It would show me the error, but it would simply show the project name under the resource column.

All the normal attempts to resolve the issue didn't work including cleaning the project, recreating the project, and even reinstalling Flex Builder (w/2.0.1). Finally, the only thing that resolved it was deleting all of the files and rebuilding my source code from SVN.

Saturday, January 20, 2007

Column Information

Here's another extremely useful script that lists column information for all tables in a given database. The attached view contains just about anything related to a column definition in SQL Server 2000. The query that you'll see after the view definition contains the following columns.
  • Table Name
  • Column Name
  • Type (and size if applicable)
  • Nullability
  • Default Value
  • Description

There is a lot more information that you can gleam from the view, but the above are the basics that I find really handy.

You can download it here...

Extended Properties of Tables

Here's another old but handy script that will list out extended properties on all tables for a given database. This comes in handy for documentation purposes, or to simply learn more about your db if your tables have any extended properties.

You can download it here...

Foreign Key Information

Quite some time back I put together a script for SQL Server 2000 that lists out all of the primary key to foreign key relationships. It's a simple script that generates a nice little listing which can be used to get a better understanding of a new database, or simply an easy way to help document an existing one.

You can download it here...

Wednesday, January 10, 2007

Microsoft Breaks HTML Rendering in Outlook 2007

I saw this on Digg, but figured it was worth mentioning. Apparently Microsoft chose to use the same html rendering engine in outlook that word uses, so get ready for a dumbed-down feature set. You need to be aware of this if you're sending out any html formatted emails. Here is a snippet of what you need to be aware of:
  • no support for background images (HTML or CSS)
  • no support for forms
  • no support for Flash, or other plugins
  • no support for CSS floats
  • no support for replacing bullets with images in unordered lists
  • no support for CSS positioning
  • no support for animated GIFs

http://www.sitepoint.com/blogs/2007/01/10/microsoft-breaks-html-email-rendering-in-outlook/

Monday, January 08, 2007

Case sensitivity in SQL Server

Microsoft SQL Server by default is case-insensitive which for the most part is very handy when searching and sorting data. There are times though where this isn't ideal, such as managing usernames or passwords.

If you take a look at the DDL of a table, you'll notice that most of your text-based columns including char and varchar fields use "COLLATE SQL_Latin1_General_CP1_CI_AS". If you would like certain columns to be case sensitive you will want to use "COLLATE SQL_Latin1_General_CP1_CS_AS" for your column definition. Please note the substitution of CI for CS in the collation statement.

If you don't have the option to change your column definition, there are a few other options to consider such as casting your columns to varbinary values when performing searches.

NYC Gas Leak?

If you're listening to the news, chances are they are talking about the gas leaks in NYC. Those of you who know me may also know that my roommate, aka, 'the doctor', is somewhat of a rocket scientist.

He said that a single bottle of mercaptan could cause all of Manhattan to stink like gas, seeing that gas only has one part per billion of mercaptan added to it.

Apparently a bad joke played on people at oil/gas refineries includes putting a drop of mercaptan on the engine block of a car... :-)

Friday, January 05, 2007

Migrating Legacy Applications

My most recent project involves WebFocus from Information Builders. Although WebFocus is a very powerful platform, the client was still using a fairly old version so we opted to move the application to SQL Server. This in itself was quite a task as WebFocus doesn't offer an ODBC connector to pull data out of it's proprietary database.

WebFocus allows you to export data directly to SQL Server, Excel, CSV, and many other file formats or database systems, but migrating a real world application out of WebFocus wasn't nearly as simple as they lead you to believe.

In comes Data Integrator, a product from Pervasive. Data Integrator is a very powerful tool that allows you to move data to-and-from roughly 150 different file formats and database platforms. Data Integrator allows you to build an easy and reproducible process to migrate data out of your legacy applications.

This white paper about Intuit shows the true power available within Pervasive's suite of products, and I highly recommend taking a look if you find yourself needing to migrate a legacy application. Although the white paper shows an extraordinary use of their products, they can be used to simplify even the most basic of integration projects.

Feel free to ping me at michael@omnicypher.com if you find yourself heading down this road. I would be more than happy to help out and/or share some of my experiences with this process.