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...