|RAP focus after shell setVisible [message #997248]
||Fri, 04 January 2013 17:03
|| John Gymer
Registered: November 2012
Another focus-related query related to RAP vs SWT...|
I have a couple of Shells, one of which is made hidden with shell.setVisible(false) previously.
Now in a later event handler I need to make that shell visible again, make it active (bring it to front of Z order of Shells) and give a specific widget on it the keyboard focus.
Here is the code to make it visible again:
The result is that the Shell becomes visible again, but the forceActive does not bring it to the front of the Z-Order. The setFocus on the Text widget works ok, putting the caret into that field, which looks really wierd if the 2 Shells overlap - you see the cursor blinking through the other Shell! Essentially you have keyboard focus to a non-active Shell, which might be placed behind another Shell.
If I tweak the code a little, I can successfully bring the other Shell to focus using:
However, if I add myText.setFocus() back in at the end, then the myShell.forceFocus() is not honoured... sort of makes sense since we are referring to keyboard input here, not Z-Order.
So, to my eye it appears to be a bug that forceActive() on the Shell does not appear to have any effect in RAP... or am I missing the point somewhere?!
By the way, I'm using Nightly 2013/01/03 RAP 2.0 M4, Nightly ClientScripting etc. etc.
Just because you can doesn't mean you should
Powered by FUDForum
. Page generated in 0.01808 seconds