Consultor Eletrônico



Kbase P162370: How to call back to a .NET Form from a persistent .w window?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   23/03/2010
Status: Unverified

GOAL:

How to call back to a .NET Form from a persistent .w window?

GOAL:

How to tell a parent .NET Form that a child window (a persistently run .w) has been closed?

FACT(s) (Environment):

Windows
OpenEdge 10.2x

FIX:

If you have a .NET Form which runs a .w persistently and when that .w is closed by the user you want to run some code back in the .NET Form you need to do the following:

1) In the .NET Form create a new method that contains the code you want to execute when the .w is closed
2) In the .NET Form change the RUN abc.w PERSISTENT statement so that you pass THIS-OBJECT as an input parameter)
3) In the definitions section of the .w, define an input parameter as the name of your .NET Form class
4) In the main block section of the .w, modify the ON CLOSE OF THIS-PROCEDURE statement so that it looks like the following:

ON CLOSE OF THIS-PROCEDURE
DO:
RUN disable_UI.
TheParameterNameDefinedInStepNumber3:TheMethodNameDefinedInStepNumber1().
END.

This will pass the instance of the .NET Form to the persistent .w and then when the .w is closed the method in the .NET Form will be invoked.