[Logo] Enterprise Client Community
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Tree doesn't open context menu on first click (Swing!)  XML
Forum Index -> Development
Author Message
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hello,

I have a tree built with ComponentNodes (exactly like DemoWorkplace -> Grids and Trees -> Grid in Grid -> Individual Column Layout).
After the tree becomes larger (more columns) while the development, the context menu doesn't appear at the first click on a row. onRowSelect() is called. But one have to right click a second time.

May be the row doesn't focus quick enough or something goes wrong in focus management?

Regards,
Joachim


Client Log:

Code:
 2023:07:06 17:14:57:573 | 23     | INFO     | synch end .......... org.eclnt.client.page.Page>callServerRun
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: at 71/11 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: at 71/11 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: at 71/1 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: at 71/-9 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: at 71/-19 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:905 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:921 | 23     | INFO     | Showing popup menu: at 71/-29 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:921 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:921 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:921 | 23     | INFO     | Showing popup menu: at 71/-39 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:57:921 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 ..
 
 many times
 
 ...
 2023:07:06 17:14:58:130 | 23     | INFO     | Showing popup menu: at 71/-929 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:130 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:130 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:130 | 23     | INFO     | Showing popup menu: at 71/-939 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:130 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:138 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Showing popup menu: at 71/-949 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Showing popup menu: at 71/-959 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Showing popup menu: at 71/-969 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Error occurred when opening popup menu: java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Showing popup menu: at 71/-979 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | INFO     | Showing popup menu: size 161/346 .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 2023:07:06 17:14:58:140 | 23     | SEVERE   | Error occurred when opening popup menu .......... org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower>openMenu
 .......... Stacktrace Info ..........
 java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location
 	at java.desktop/java.awt.Component.getLocationOnScreen_NoTreeLock(Unknown Source)
 	at java.desktop/java.awt.Component.getLocationOnScreen(Unknown Source)
 	at java.desktop/javax.swing.JPopupMenu.show(Unknown Source)
 	at org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower.openMenu(POPUPMENUElement.java:65)
 	at org.eclnt.client.elements.impl.POPUPMENUElement$PopupMenuShower$1.run(POPUPMENUElement.java:79)
 	at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
 	at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
 	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
 	at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
 	at java.base/java.security.AccessController.doPrivileged(Native Method)
 	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
 	at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
 	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
 	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
 	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 	at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 	at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
 
CaptainCasa

Power User
[Avatar]

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

Hi Joachim,

please use the attribute POPUPMENULOADROUNDTRIP=true on the corresponding component (or if you do the definition on FIXGRID-level then it's attribute ROWPOPUPMENULOADROUNDTRIP). Only then teh popup menu waits with opening for the correspdonding roundtrip to be received from the server-side - otherwise it immediately opens with existing data.

Kind regards! Björn

Björn Müller, CaptainCasa GmbH
unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Thank You! I forgot.

But is there a chance that the focus managemt waits too?
On the first click on the row the row is selected, but the only one editable control isn't focused. On the next click elsewhere in the row the focus is in the field.

Regards,
Joachim
 Filename focus.JPG [Disk] Download
 Description
 Filesize 40 Kbytes
 Downloaded:  80 time(s)

 Filename focus2.JPG [Disk] Download
 Description
 Filesize 33 Kbytes
 Downloaded:  72 time(s)

unger

Power User

Joined: 22/07/2008 05:19:28
Messages: 261
Offline

Hi Björn,

POPUPMENULOADROUNDTRIP=true was the solution, also for proper focus management.



Kind regards,
Joachim
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team