Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP focus after shell setVisible(Shell/Field focus after shall is made visible again)
RAP focus after shell setVisible [message #997248] Fri, 04 January 2013 12:03 Go to next message
John Gymer is currently offline John Gymer
Messages: 185
Registered: November 2012
Location: UK
Senior Member
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:

...
myShell.setVisible(true);
myShell.forceActive();
myText.setFocus();
...


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:

...
myShell.setVisible(true);
myShell.forceFocus();
...


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.

Thanks, John


---
Just because you can doesn't mean you should
Re: RAP focus after shell setVisible [message #997624 is a reply to message #997248] Fri, 04 January 2013 13:28 Go to previous message
Tim Buschtoens is currently offline Tim Buschtoens
Messages: 355
Registered: July 2009
Senior Member
Hi.

If you would open a bugzilla entry and attach a snippet (EntryPoint)
that demonstrates your issue, that would be perfect.

Greetings,
Tim


--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:ClientScripting VerifyListener determine keystroke
Next Topic:HttpSession Listener
Goto Forum:
  


Current Time: Wed Apr 16 12:21:36 EDT 2014

Powered by FUDForum. Page generated in 0.01651 seconds