[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
KeyboardFocusManager  XML
Forum Index -> Development
Author Message
chafner

Active

Joined: 28/04/2011 15:22:44
Messages: 17
Offline

Hello Björn,

I've got a problem:

In our app we are starting the PageBrowser out of a Swing Application. That, so far, works fine.
Our Client requested a feature: Not only the TAB-Key should forward the Keyboard Focus in the Application, but also the ENTER-Key should do that.

So heres a little bit of code that does this (found in the www):
Code:
 Set forwardKeys = getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS);
 Set newForwardKeys = new HashSet(forwardKeys);
 newForwardKeys.add(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
 setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,  newForwardKeys);
 


This code is inserted in the surrounding JPanel, which opens the PageBrowser.

It works well.

BUT: If I open a PopUp (ModalPopup) it doesn't work anymore... Only the TAB-Key forwards the Keyboard Focus.

Is there a workaround?

I don't want to do a lot of serversided logic to reimplement the whole Focus thing.

Regards
Christian
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5534
Offline

...wihtout thinking too deep...:

There is a client parameter "tabonenter" which you can set to "true". Could you apply this client parameter when starting the PageBrowser? This is the official way to do it.

Regards, Björn

Björn Müller, CaptainCasa GmbH
chafner

Active

Joined: 28/04/2011 15:22:44
Messages: 17
Offline

No, I don't find it... where can I apply this client parameter to the PageBrowser? there is no method like setClientParameter or setTabonenter or something like this...

Thx,
Christian
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5534
Offline

This is the way to pass the client parameters (all the ones listed in the appendix of the Developers' Guide):


Code:
                     Map<String,String> configParams = new HashMap<String, String>();
                    configParams.put("...","..."); // pass parameters
                     PageBrowser.initClientParameters(configParams);
                     // now create PageBrowser instance... etc.
 


Regards, Björn

Björn Müller, CaptainCasa GmbH
chafner

Active

Joined: 28/04/2011 15:22:44
Messages: 17
Offline

sometimes it's just too easy... ;)

it works, thanks!
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team