tags:

views:

42

answers:

0

I have a slightly odd problem.

I have a 2 flex applications that both use some RSLs. RSL1 declares a container that forms get shown in, and RSL2 defines a form that gets shown.

App 1 is reasonably complicated, and works just fine - the form container from RSL1 can be instantiated, and the form from RSL2 can be shown inside it.

App 2 is pretty simple, and on doing the same sequence it blows up in the flex framework. Looking more closely, the reason it does this is on form elements that have 'required=true' indicator on them. In flex's FormItem.as, it does the following :

var indicatorClass:Class = getStyle("indicatorSkin") as Class;
indicatorObj = IFlexDisplayObject(new indicatorClass());

In App1, I can see by single-stepping, it resolves to the default image defined in Assets.swf, and all is fine.

In App2 however, indicatorSkin is not defined, 'null' is returned, and everything goes downhill from there.

If in App2 I create a 'fake' form in the main window with a required field, suddenly the indicatorSkin IS defined for all, and everything works. But this is a hack.

It seems like there is something wrong with flex only having certain items within the style cache, and maybe it not 'knowing' that these styles actually are important. I think there are other missing styles (e.g: The date selector icon is missing and the background colors are screwy), but I can't see what I need to change in order to get it to work.

The apps all link to the framework as a RSL.

Is there something I need to do / call to ensure the correct styles are present in the build (or some magic regenerateStyleCache runes )?