Project

General

Profile

Bug #4074

Mismatching ROW-ENTRY/LEAVE events

Added by Stanislav Lomany about 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
05/07/2019
Due date:
% Done:

100%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

row-leave-entry.p Magnifier (1003 Bytes) Stanislav Lomany, 05/07/2019 05:58 PM

browse-outside-entry.p Magnifier (868 Bytes) Stanislav Lomany, 10/05/2019 06:11 PM

History

#1 Updated by Stanislav Lomany about 7 years ago

The issue is that in FWD ROW-ENTRY and ROW-LEAVE events are generated when user leaves or enters a row in editing mode. While in 4GL it is generated when editing within a row is started or finished, i.e. if editing is active and you click a non-editable cell in current row, ROW-LEAVE event is generated. I guess that action couldn't be done in ChUI so the legacy logic migrated to GUI.

The testcase is attached. General reproduction for the issue:
  1. click on cell "1"
  2. click on cell "2"
  3. click on cell "22"
There is another, I believe, related, severe issue. Reproduction:
  1. type "test" (into cell "11")
  2. click on cell "1"
  3. click on cell "2"

You will see the following data

1     11     111
2     test   122

instead of
1     test   111
2     22     122

I suppose that updated row data is not released because of the missing ROW-LEAVE event.

#2 Updated by Stanislav Lomany about 7 years ago

Also, this code in Browse.goUp doesn't seem valid:

...
else if (!isSelectionMultiple() && fireValueChanged)
{
   invokeRowEntryTrigger(true);    // <-----

As well as the similar code in Browse.goDown. BTW it should be refactored as the code is duplicated.

#4 Updated by Adrian Lungu almost 7 years ago

  • % Done changed from 0 to 50
  • Status changed from New to WIP
  • Assignee set to Adrian Lungu

I made a fix for some ROW-ENTRY, VALUE-CHANGED and ROW-LEAVE triggers. Now the ROW-ENTRY fires only when the row is started to be edited, ROW-LEAVE when the entire row is released. Also some minor fixes to the VALUE-CHANGED firing momentum.

I could recreate the scenario in #4074-1. Indeed, it is due to the fact that the edit is stopped but the row isn't released. A similar behavior I encountered when clicking on the side of the browse to select the whole row and, after this, changing the row. This is however fixed only for the case mentioned here.

The changes were committed on branch 4239a/11329, meant to solve #4239. I will continue with row-leave-entry.p in order to solve the row leaving issue.

#5 Updated by Adrian Lungu almost 7 years ago

  • % Done changed from 50 to 100
  • Status changed from WIP to Review

The issue has been fixed. The row is now released if exiting editing mode. The main modification comes in BrowseGuiImpl.rowClicked, where the difference between stopEdit and leaveRow is made. The given example works as expected. The changes were committed in 4239a revision 11330 and are ready for review.

#6 Updated by Stanislav Lomany almost 7 years ago

The code in 4239a 11329-11330 is good.

#7 Updated by Greg Shah almost 7 years ago

Please merge these changes into 4103a and dead-archive 4239a.

#8 Updated by Adrian Lungu almost 7 years ago

Changes were merged into 4103a rev 11341. Branch 4239a was dead-archived.

#9 Updated by Greg Shah almost 7 years ago

  • Status changed from Review to Test

#11 Updated by Stanislav Lomany almost 7 years ago

Is 4103a going to be merged into trunk soon?

#12 Updated by Greg Shah almost 7 years ago

4103a has been rebased and is in testing right now. Do you need it for #3940?

#13 Updated by Stanislav Lomany almost 7 years ago

4103a has been rebased and is in testing right now. Do you need it for #3940?

It probably would be nice to have it.

#14 Updated by Greg Shah almost 7 years ago

Stanislav Lomany wrote:

4103a has been rebased and is in testing right now. Do you need it for #3940?

It probably would be nice to have it.

You can branch from 4103a and then apply the 3940a diffs on top.

#15 Updated by Stanislav Lomany almost 7 years ago

I suppose it's the best place to put a testcase that demonstrates unwanted row-entry events and duplicate row-entry events in FWD.

#16 Updated by Stanislav Lomany over 6 years ago

I suppose it's the best place to put a testcase that demonstrates unwanted row-entry events and duplicate row-entry events in FWD.

Regarding the double row-entry events when non-focused browse is clicked:
  1. The first row-entry event is raised as a reaction to the entry event. Note than the event at this point is triggered for the current browse row, not the clicked row.
  2. Mouse click event handler raises the second row-entry event for the clicked row.

Basically I want to avoid raising row-entry if an entry event was generated by mouse click (as opposed to, say, the case when the entry event was generated when the browse gets the focus because of a key press). Browse gets entry earlier than the mouse event, so I cannot set some state within browse (and don't actually want).

How can I do it - by adding another field to KeyInput to extend the entry event?

#17 Updated by Greg Shah over 6 years ago

You could create a subclass of KeyInput for use with entry events.

#18 Updated by Stanislav Lomany over 6 years ago

Greg, also there's a FocusEvent generated by requestFocus called right after the row entry event is generated, which starts unplanned startEdit. Should I subclass FocusEvent this time?

#19 Updated by Greg Shah over 6 years ago

Yes, that would be OK as well.

#20 Updated by Greg Shah over 6 years ago

4103a is in trunk. Please put your changes in 4335a.

#21 Updated by Stanislav Lomany over 6 years ago

Please put your changes in 4335a.

I was going to put them into 4231b as they seem to be more risky. Is it OK?

#22 Updated by Greg Shah over 6 years ago

Yes, 4231b is fine.

#23 Updated by Stanislav Lomany over 6 years ago

Fix for double ROW-ENTRY events is committed into 4231b rev 11472. Please review.

#24 Updated by Hynek Cihlar over 6 years ago

Code review 4231b review 11472.

Please also test the case when you click in a browse, without focus, directly in an editable cell. If I interpret your changes correctly, the cell will not start edit. But I wonder if the edit should be started.

I don't think EntryEvent class is the way to go. At this level of granularity we should also create classes for SE_LEAVE and other synthetic events, which obviously doesn't make sense. If new class I think it would make sense to introduce something like SyntheticKeyInput and cover all synthetic codes. But even this I don't think is necessary. Also considering how complex our eventing system is already, this could introduce issues.

Since we already use a mouse discriminator field in other event classes, and since the ExtendedFocusEvent class has no other purpose, I would remove the class and just put mouse field in FocusEvent.

#25 Updated by Stanislav Lomany over 6 years ago

Please also test the case when you click in a browse, without focus, directly in an editable cell. If I interpret your changes correctly, the cell will not start edit. But I wonder if the edit should be started.

This purpose of this task is to fix exactly this case. Yes, the editing should be started.

I don't think EntryEvent class is the way to go... I would remove the class and just put mouse field in FocusEvent.

I don't mind putting an extra boolean into FocusEvent and to create SyntheticKeyInput.

#26 Updated by Greg Shah over 6 years ago

Hynek: Does this satisfy your notes in #4074-24?

#27 Updated by Hynek Cihlar over 6 years ago

Greg Shah wrote:

Hynek: Does this satisfy your notes in #4074-24?

Yes I'm sure Stanislav tested the mentioned use case in #4074-24.

#28 Updated by Greg Shah over 6 years ago

  • Status changed from Test to Closed

#29 Updated by Stanislav Lomany over 6 years ago

Closing seems to be premature. I didn't implement Hynek's idea (I got confirmation only now). Should I implement it?

#30 Updated by Greg Shah over 6 years ago

  • % Done changed from 100 to 90
  • Status changed from Closed to WIP

Should I implement it?

Yes. The change can be put into 4335a.

#31 Updated by Adrian Lungu over 6 years ago

I have recently re-based 4231b where there is a revision regarding #4074-23. I converted AW recently and it seems like there is an issue with the fix. A short log is in #4440-8 (the AW reproducing steps are in #4440-1). Was the cause somehow considered in #4074-24 re-implementation? Or the new implementation has nothing to do with solving #4440-8?

Another aspect: due to #4074-30, is seems that the new implementation will be committed in 4335a anyway, so no hope for 4231b to be fixed?

#32 Updated by Greg Shah over 6 years ago

Another aspect: due to #4074-30, is seems that the new implementation will be committed in 4335a anyway, so no hope for 4231b to be fixed?

This is my mistake. The improvement should go into 4231b with the original fix.

#34 Updated by Greg Shah over 6 years ago

  • % Done changed from 90 to 100
  • Status changed from WIP to Test

#35 Updated by Greg Shah about 6 years ago

  • Status changed from Test to Closed

Task branch 4231b has been merged to trunk as revision 11347.

Also available in: Atom PDF