Thursday, November 9, 2006

Flex Problem : Datechooser control not displaying number digits for days of month

I recently had the following problem:

I have had this completely stylized application that I had been working on for quite some time. I went to add a simple date chooser control to the application. And this is what I got...

The solution was not obvious. (Well at least not to an idiot like me.) 


Now as you can see this wasn’t going to work. At first, I assumed that my style for the control was messed up; however it was ok.

DateChooser {
headerColors: #fab000, #ff6600;
todayColor: #666666;
rollOverColor: #ffff00;
selectionColor: #ff9900;
color: #000000;
backgroundColor: #ffffff;

I messed around with the thing for a about half an hour. In that time I was able to determine that the error occurred whenever I would embed the date control inside of any container that was at any level inside of an accordion container. If the date chooser is not contained inside of an accordion, or any container that is at some level inside of an accordion, then the date chooser renders correctly. What I wondered was the problem. At first, I thought maybe this was some Flex bug, some incompatibility problem with the accordion, and the date chooser. I couldn’t figure out why it only occurred with the accordion container. After all, it is just another container. Then I decided to look at something that makes the accordion container different... something that I did to make it different.

Accordion {
headerHeight: 20;
dropShadowEnabled: true;
shadowDistance: 3;
backgroundAlpha: 1;
highlightAlphas: 0.36, 0.02;
llColors: #6633, #0033, #cc00, #9900;
selectedFillColors: #fab000, #3300; 
themeColor: #6600;
backgroundColor: #fab000;
borderColor: #9900;
textIndent: 18;
openDuration: 441;

At first, I didn’t notice what was causing the problem I wasn’t even positive that the style was causing the problem. I started by commenting out the entire style definition for the accordion. That worked... the date chooser rendered correctly. Of course, that wasn’t going to work. I then went and commented out different sections in the style until I figured out what was causing the problem......

There it was, in the end, a rather simple solution.

No comments: