Tricky sorting and trigger activation
Author: zdenek.socha@fullsys.cz (sochaz)
Hello, we're facing a problem with trigger activation and sorting occurrences in a grid. I'll try to describe the situation. Short description: - user enter data in a field, then clicks on a column header to sort the entity, then leaves the field... some triggers are never activated (e.g. ValueChanged) Detailed description:
- user enters data in a field
- user decides to sort occurrences - so he clicks on a column header - this activates extended trigger, which calls a global procedure
- sort is performed, setocc to the same occurrence before sorting and prompt is set back to the original field
- some triggers are not fired, for example ValueChanged, $fieldendmod is not set
This is quite a problem... in common situation, when user enters data in a field (which is part of the primary key), these triggers are activated: Value Changed, Validate Field, Leave Field (with $fieldendmod set), Leave Modified Key, Next Field But if user sorts data... nothing is activated, but only Extended trigger of the grid widget... and upon leaving field, only these triggers are activated: Validate Field, Leave Field (with $fieldendmod *not* set), Leave Modified Key. So, Value Changed and Leave Field (with $fieldendmod set) is *never* activated. There seems to be no workaround for this bug. We're facing this problem only with grid widget, because with no grid, there are "sorting buttons" upon entity, so if user clicks this "sorting button", all triggers are activated *before* sorting, that is Value Changed, Validate Field, Leave Field etc.... but with grid widget, sorting is done on column headers, and Uniface skips all triggers. Have anyone tried to solve this problem? It seems to be quite complicated, since $fieldendmod can't be set. And according ulibrary, this function is valid only in Leave Field trigger, so we can't use it in extended trigger to check it prior sorting... even though, user leaves the field, Uniface skip some triggers and never fire them.
Zdeněk




