setFocus?

2005
3
07-16-2010 10:59 AM
JayGeisen
New Contributor III
So, does anyone know why I am able to set focus to some TextInput boxes and not some others?  For instance, I am able to use setFocus() in the locate widget, but not in the printwidget or searchwidget.  Any ideas?

Jay
Tags (2)
0 Kudos
3 Replies
ChenJuequan
New Contributor
Try to use 'focusManager.setFocus()'
0 Kudos
JayGeisen
New Contributor III
Chen,

Thanks for the reply.  I've tried using focusManager as well, but that doesn't work either.  I don't understand why setFocus works on some widgets and not on others.  Also, it would be nice to have focus on whatever widget is open upon loading the application.  It seems this is even more difficult because you need to take focus from the application itself before you can assign it to any particular widget.  Any help anyone could give is appreciated.  I've been trying to figure this out for days now.

Thanks,
Jay
0 Kudos
SreeS
by
New Contributor
Chen,

Thanks for the reply.  I've tried using focusManager as well, but that doesn't work either.  I don't understand why setFocus works on some widgets and not on others.  Also, it would be nice to have focus on whatever widget is open upon loading the application.  It seems this is even more difficult because you need to take focus from the application itself before you can assign it to any particular widget.  Any help anyone could give is appreciated.  I've been trying to figure this out for days now.

Thanks,
Jay


Hi Jay,

Any luck with setting the focus.

I wanted to set the focus on the mx:TextInput of SearchWidget.

Im able to do it for the widgetConfigLoaded event but when I try set focus using "focusManager.setFocus(txtSearch);" in widgetOpenHandler I get error #1009:Cannot access a property or method of a null object reference.

Thanks,
Sree
0 Kudos