Project

General

Profile

Bug #2703

Bug #2677: fix drawing and functional differences between P2J GUI and 4GL GUI

VIEW of a dynamic widget abends

Added by Greg Shah over 8 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

minimal_view_dynamic_widget_in_4gl_20150910.png (3.89 KB) Greg Shah, 09/10/2015 06:33 PM


Related issues

Related to User Interface - Bug #2754: dynamic widget attribute assignment breaks when the FRAME attribute is assigned late New

History

#1 Updated by Greg Shah over 8 years ago

Running this code (testcases/uast/minimal_view_dynamic_widget.p):

DEF VAR f AS HANDLE.

DEFINE FRAME fr0 WITH SIZE 40 BY 10.

CREATE FILL-IN f.
f:SCREEN-VALUE = "ttt".
f:FRAME = FRAME fr0:HANDLE.

VIEW f.

will generate this abend:

Exception in thread "AWT-EventQueue-0" com.goldencode.p2j.net.SilentUnwindException: Connection ended abnormally
        at com.goldencode.p2j.net.RemoteObject$RemoteAccess.invokeCore(RemoteObject.java:1420)
        at com.goldencode.p2j.net.InvocationStub.invoke(InvocationStub.java:97)
        at com.sun.proxy.$Proxy2.getLegacyTextMetrics(Unknown Source)
        at com.goldencode.p2j.ui.client.FontManager.getTextMetrics(FontManager.java:719)
        at com.goldencode.p2j.ui.client.FontManager.getTextWidth(FontManager.java:298)
        at com.goldencode.p2j.ui.client.gui.MenuItemGuiImpl.width(MenuItemGuiImpl.java:426)
        at com.goldencode.p2j.ui.client.gui.SubMenuGuiImpl.getMaxSubMenuItemWidth(SubMenuGuiImpl.java:270)
        at com.goldencode.p2j.ui.client.gui.MenuGuiImpl.width(MenuGuiImpl.java:529)
        at com.goldencode.p2j.ui.client.gui.MenuGuiImpl.width(MenuGuiImpl.java:345)
        at com.goldencode.p2j.ui.client.widget.AbstractContainer.dimension(AbstractContainer.java:227)
        at com.goldencode.p2j.ui.client.widget.AbstractWidget.physicalDimension(AbstractWidget.java:335)
        at com.goldencode.p2j.ui.client.widget.AbstractWidget.physicalBounds(AbstractWidget.java:941)
        at com.goldencode.p2j.ui.client.widget.AbstractContainer.findMouseSource(AbstractContainer.java:259)
        at com.goldencode.p2j.ui.client.gui.WindowGuiImpl.findMouseSource(WindowGuiImpl.java:625)
        at com.goldencode.p2j.ui.client.gui.driver.swing.SwingMouseHandler.findMouseSource(SwingMouseHandler.java:249)
        at com.goldencode.p2j.ui.client.gui.driver.swing.SwingMouseHandler.processAction(SwingMouseHandler.java:282)
        at com.goldencode.p2j.ui.client.gui.driver.swing.SwingMouseHandler.processAction(SwingMouseHandler.java:264)
        at com.goldencode.p2j.ui.client.gui.driver.swing.SwingMouseHandler.mouseClicked(SwingMouseHandler.java:52)
        at java.awt.Component.processMouseEvent(Component.java:6519)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
        at java.awt.Component.processEvent(Component.java:6281)
        at java.awt.Container.processEvent(Container.java:2229)
        at java.awt.Component.dispatchEventImpl(Component.java:4872)
        at java.awt.Container.dispatchEventImpl(Container.java:2287)
        at java.awt.Component.dispatchEvent(Component.java:4698)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4501)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
        at java.awt.Container.dispatchEventImpl(Container.java:2273)
        at java.awt.Window.dispatchEventImpl(Window.java:2719)
        at java.awt.Component.dispatchEvent(Component.java:4698)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
        at java.awt.EventQueue.access$300(EventQueue.java:103)
        at java.awt.EventQueue$3.run(EventQueue.java:706)
        at java.awt.EventQueue$3.run(EventQueue.java:704)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.awt.EventQueue$4.run(EventQueue.java:720)
        at java.awt.EventQueue$4.run(EventQueue.java:718)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
com.goldencode.p2j.net.SilentUnwindException: Connection ended abnormally
        at com.goldencode.p2j.net.Queue.transactImpl(Queue.java:1142)
        at com.goldencode.p2j.net.Queue.transact(Queue.java:585)
        at com.goldencode.p2j.net.BaseSession.transact(BaseSession.java:223)
        at com.goldencode.p2j.net.HighLevelObject.transact(HighLevelObject.java:163)
        at com.goldencode.p2j.net.RemoteObject$RemoteAccess.invokeCore(RemoteObject.java:1424)
        at com.goldencode.p2j.net.InvocationStub.invoke(InvocationStub.java:97)
        at com.sun.proxy.$Proxy4.standardEntry(Unknown Source)
        at com.goldencode.p2j.main.ClientCore.start(ClientCore.java:277)
        at com.goldencode.p2j.main.ClientCore.start(ClientCore.java:100)
        at com.goldencode.p2j.main.ClientDriver.start(ClientDriver.java:201)
        at com.goldencode.p2j.main.CommonDriver.process(CommonDriver.java:398)
        at com.goldencode.p2j.main.ClientDriver.process(ClientDriver.java:95)
        at com.goldencode.p2j.main.ClientDriver.main(ClientDriver.java:267)
Caused by: com.goldencode.p2j.net.ApplicationRequestedStop: Queue stop is requested by application
        at com.goldencode.p2j.net.Conversation.block(Conversation.java:329)
        at com.goldencode.p2j.net.Conversation.waitMessage(Conversation.java:257)
        at com.goldencode.p2j.net.Queue.transactImpl(Queue.java:1128)
        ... 12 more

In the 4GL it should look like this:

#2 Updated by Greg Shah over 8 years ago

  • Assignee set to Eugenie Lyzenko

#3 Updated by Eugenie Lyzenko over 8 years ago

The root cause is in the sample:

...
CREATE FILL-IN f.
f:SCREEN-VALUE = "ttt".
f:FRAME = FRAME fr0:HANDLE.
...

Setting screen value is happening too early. We need to set up frame handle first. If not to do this currently code:
...
   public void setScreenValue(character value)   
   {
      frame.setScreenValue(this, value);
   }
...

will produce NPE because frame == null. On the other hand the code:
...
CREATE FILL-IN f.
f:FRAME = FRAME fr0:HANDLE.
f:SCREEN-VALUE = "ttt".
...

works fine.

Consideration. If we need to support the code that will assign something important before frame handle is ready - we need to implement some feature that will collect the pending assignments and run them in postponed mode when frame handle has been assigned.

To fix this particular issue we can save the screen value in GenericWidget and make frame.setScreenValue(this, value); call later when frame member is assigned.

#4 Updated by Greg Shah over 8 years ago

This is the same problem as noted in #2754. The solution needs to be generic.

The screen-value may be a tricky one because we don't ever actually store the screen-value in the widget. We always store it in the frame's screen-buffer. Although we could cache the value and push it into the screen-buffer later, I suspect that in the 4GL you might be able to get some funky data conversion behavior by using screen-value. I saw an example of this in some code based on the ADM framework.

Anyway, don't work on this any further at this time. We will solve this at the same time as #2754.

#5 Updated by Greg Shah about 8 years ago

  • Target version changed from Milestone 12 to Milestone 16
  • Assignee deleted (Eugenie Lyzenko)

#6 Updated by Greg Shah over 7 years ago

  • Target version changed from Milestone 16 to Cleanup and Stabilization for GUI

Also available in: Atom PDF