Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Adobe Flex SDK Previous
-
None
-
Affected OS(s): All OS Platforms
Affected OS(s): All OS Platforms
Language Found: English
Description
getStyle() and setStyle() methods of UIComponent have different if-expressions inside. setStyle checks if moduleFactory is set while getStyle checks if StyleProtoChain is initialized.
This leads to situations when .getStyle(styleName) != styleValue right after setting the style with .setStyle(styleName, styleValue).
This seems to be a rather recent addition cause it's not present in beta 2 public release. I've check the latest stable nightly build - r13875. I've looked into the issue and it's still present.
This behaviour causes the following problem (among others) - skins for dynamically created components placed into other dynamically created components are not properly initialised, which in some cases (ex. required skin parts) lead to runtime exceptions.
Steps to reproduce:
1. Create custom skinned component with required skin part and a skin for it.
2. Dynamically create it's instance.
3. instance.setStyle("skinClass", ComponentSkin);
4. Dynamically create container for the component and add the component to conatiner's display list.
5. Add the container to application display list.
Actual Results:
Runtime exception - required skin part not found / skin for component is undefined depending on the base class of the skinned component (SkinnableContainer or SkinnableComponent)
Expected Results:
No runtime exception.
Workaround (if any):
Apart from this issue I'm quite sure getStyle()/setStyle() inconsistency will cause other errors in style management-related code.