Consultor Eletrônico



Kbase P169010: How to generically reduce the number of places to code for textChanged in a form
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   30/06/2010
Status: Unverified

GOAL:

How to generically reduce the number of places to code for textChanged in a form

GOAL:

How to determine when a value has changed on an ABL Form

GOAL:

Is it possible to code an any-key type trigger on a .NET form to handle user interaction/changes for all components on the form?

FACT(s) (Environment):

Windows
OpenEdge 10.2x

FIX:

There is no event that can be used to trap all changes on a form and this would be a rather difficult to handle anyway because each component type has it's own event signature with potentially differing input/output parameters.

One could write a custom form template that loops through all of its objects after they have been created and subscribe them to a single event handler for each object type, thus minimizing the number of event handler methods need to be written and limiting duplication of code for common tasks. This method could call into a more generic form method for handling form specific tasks and perform object specific tasks as needed in an method override or by overloading the method and executing SUPER for the generic stuff.

Another way about this would be to create an ABL Inherited Control for each type of component that is used. This allows you to write a textChanged (or object specific) event handler, to handle the standard logic, once for each object type. This logic could be overridden or overloaded on an instance basis by calling some event in the form.