February 17, 2007

Text control with truncateToFit property support

As you probably know, Label control supports truncateToFit property, while Text doesn't. Even if you explicitly set it to true in your particular Text instance, nothing happens. I have created TruncatedText class that acts the similar way as Label does. If a TruncatedText instance is sized to be smaller than its text, the text is truncated with "...":

January 10, 2007

How to prevent pop-up blocking in Firefox

Using navigateToURL() method causes pop-up blocking feature activation in Firefox since Flash is a plug-in:

Use window.open() JavaScript method instead. I have created URLUtil class with openWindow() static method to make it easier:

Now my blog could be opened in a new browser window this way:

January 9, 2007

Left aligned label in FormItem

FormItem class doesn't have any styles or properties to control corresponding label alignment. Right alignment is applied by default and it's good idea to keep it "as is", because some usability researches say it's more friendly for user. Though if you want to make your FormItem label left aligned, use ExtendedFormItem class instead of regular FormItem:

ExtendedFormItem label is left aligned by default, but you can set labelAlign style to "right" if necessary.