Archive

Posts Tagged ‘null’

SkinnableTextBase focusManager runtime error popup

May 5, 2011 4 comments

When you show a popup in Flex in a mobile environment, defined as the style “interactionMode” being set to InteractionMode.TOUCH in this context, that is based on a component that does not implement the mx.managers.IFocusManagerContainer interface, you will receive a runtime error when the user taps the control that is to receive focus.

Lets pretend you have a custom component that is based on <s:Group/>:

Read more…

<s:ItemRenderer/> currentState == null

October 1, 2009 1 comment

I received an Item renderer from my designer with a few states that were to be driven by some data. We are using an advanced data grid and one of the columns is rendered by this component.

We noticed that the state wasn’t reflected by the data despite the correct state being set. As it turns out, the ItemRenderer class has a getCurrentRendererState() method that can potentially return null – Specifically when there is no interaction (hovered, selected, etc…) and there is no “normal” state on your renderer.

So despite my setting the correct state, this base method was hijacking me and setting the state to null. You can fix this problem by overriding the method, or by overriding “setCurrentState” and not calling super.setCurrentState if the stateName is null.