Flex / AIR, how to set focus on user interface, button, etc.?

So, I'm trying to adjust the focus to a specific button when the application starts (or later based on certain events), so that the user can simply press the back button to press the button. However, none of the following approaches work.

protected function group1_creationCompleteHandler(event:FlexEvent):void
{
//btnBrowse.setFocus();
focusManager.setFocus(btnBrowse);
}

+3
source share
4 answers

Try:

protected function group1_creationCompleteHandler(event:FlexEvent):void
{
  callLater(btnBrowse.setFocus);
}
+4
source

To press the return button and automatically execute the event Click, on the panel, canvas, etc., where the user is located, install defaultButton="{buttonid}".

0
source

Not sure if the answer is still relevant, but try adding both.

Make the default button for the application and add focus to it in the creation event.

0
source

Source: https://habr.com/ru/post/1790766/


All Articles