Bug #10876
Date FILL-IN: Incorrect ENTER key handling in GUI mode
100%
Related issues
History
#2 Updated by Vladimir Tsichevski 8 months ago
In OE CHARACTER mode, pressing Enter produces no visible effect, whereas in FWD, it does. Thus, the same issue occurs in ChUI mode as well.
The example used in both modes is:
SESSION:DATE-FORMAT = 'mdy'. DEFINE VARIABLE dateField AS DATE VIEW-AS FILL-IN NO-UNDO FORMAT '99/99/9999'. DEFINE FRAME f dateField NO-LABEL. ENABLE ALL WITH FRAME f. WAIT-FOR WINDOW-CLOSE OF FRAME f.
#3 Updated by Vladimir Tsichevski 8 months ago
The issue originates in the following code from FillIn.processKeyEvent() (line 1737):
if (key == Keyboard.KA_RETURN)
{
if (isLinkedToBrowse())
{
...
return;
}
if (!completeEdit())
{
return;
}
if (ThinClient.getInstance().isChui() && isLastWidget)
{
... do something
}
else if (getDataEntryReturn() || (ThinClient.isDataEntryReturn() && ke.isTriggerFired()))
{
if (groupMode && !isLastInGroup())
{
... do something
}
else
{
if (isLastWidget)
{
... do something
}
else
{
... do something
}
}
}
refresh();
return;
}
The problem is that completeEdit() is called unconditionally even if no action for the RETURN key is selected. To resolve this:
- Identify which actions (marked as "... do something") require a prior call to
completeEdit(). - Remove the unconditional
completeEdit()call and add it only in the branches that truly require it.
#4 Updated by Vladimir Tsichevski 8 months ago
The Fix¶
The revised code relocates the completeEdit() call to the start of the relevant branch and moves refresh() to the end of that branch as well. The ThinClient.getInstance().isChui() && isLastWidget branch, which simply posts the GO event in CHARACTER mode, requires neither:
if (key == Keyboard.KA_RETURN)
{
if (isLinkedToBrowse())
{
... do something
return;
}
...
if (ThinClient.getInstance().isChui() && isLastWidget)
{
... post GO event
return;
}
if (getDataEntryReturn() || (ThinClient.isDataEntryReturn() && ke.isTriggerFired()))
{
// FIXME: Do we need this here?
if (!completeEdit())
{
return;
}
if (groupMode && !isLastInGroup())
{
... do something
}
else if (isLastWidget)
{
... do something
}
else
{
... do something
}
refresh();
}
return;
}
Notes on the Changes:
- The
getDataEntryReturn() || (ThinClient.isDataEntryReturn() && ke.isTriggerFired())branch has not been fully analyzed. Its logic appears complex and may introduce other discrepancies, but this fix should not affect its behavior or cause regressions.
#7 Updated by Hynek Cihlar 8 months ago
- Assignee set to Vladimir Tsichevski
#8 Updated by Hynek Cihlar 8 months ago
Code review 10876a.
completeEdit is now not called for last widget in ChUI mode. Is this expected?
Why was the FIXME comment added, does it refer to completeEdit or the return statement?
#9 Updated by Vladimir Tsichevski 8 months ago
Hynek Cihlar wrote:
Code review 10876a.
completeEditis now not called for last widget in ChUI mode. Is this expected?
Yes. See #10976-2 above:
In OE CHARACTER mode, pressing Enter produces no visible effect, whereas in FWD, it does. Thus, the same issue occurs in ChUI mode as well.
Why was the FIXME comment added, does it refer to
completeEditor the return statement?
My change does not affect this code fragment. This comment can be removed.
#10 Updated by Hynek Cihlar 7 months ago
- Status changed from Review to Internal Test
Vladimir, please address the FIXME comment and go ahead with regression testing. ChUI regression tests will be also needed. Are you able to run them already?
#12 Updated by Vladimir Tsichevski 7 months ago
Hynek Cihlar wrote:
Vladimir, please address the FIXME comment and go ahead with regression testing. ChUI regression tests will be also needed. Are you able to run them already?
Done in 10876a rev. 16332.
The fix also resolves #9913 specifically for the Enter key.
I verified it using the example from #10876-2 in both GUI and ChUI modes.
Additionally, I tested it with our large customer application - everything remains stable.
Hynek, run the ChUI test suite on my behalf.
#13 Updated by Hynek Cihlar 6 months ago
ChUI tests running.
#14 Updated by Hynek Cihlar 6 months ago
Vladimir, I found some regressions when running ChUI regression tests. Please see the results in devsrv01:/tmp files results_20260204132130.zip and results_20260204091019.zip, one set of results is from trunk the other from the branch.
#15 Updated by Hynek Cihlar 6 months ago
Vladimir, please make sure to check in any test cases that are still unchecked.