开发者

Flex Panel doesn't call focusInHandler() when it gets focus

开发者 https://www.devze.com 2022-12-17 23:28 出处:网络
I want to be notified when a FLex Panel gets or loses focus. I\'ve overridden the focusInHandler() and the focusOutHandler(), but they don\'t get called when I click on the panel开发者_开发知识库.

I want to be notified when a FLex Panel gets or loses focus. I've overridden the focusInHandler() and the focusOutHandler(), but they don't get called when I click on the panel开发者_开发知识库.

The panels style changes indicating that it has the focus, but the handler doesn't get called.

What am I missing?


Containers (and implicitly panels) aren't really focusable. Meaning that simply clicking on an empty container won't give it focus, and in consequence, won't trigger the event handler for "focusIn". In order for a container to "gain" focus, a child of that container, that implements IFocusManagerComponent interface, has to gain focus.

So if you want your panel to trigger the "focusIn" event when clicking on it, you should focus a focusable child of that panel on mouse click.


Have you tried to explicitly listen for that event:

myPanel.addEventListener(FocusEvent.FOCUS_IN, myEventHandler);

and made sure that it was getting called?

0

精彩评论

暂无评论...
验证码 换一张
取 消