Consultor Eletrônico



Kbase 21595: ADM. How To Stop Users From Changing Pages In a Transaction
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

ADM. How to prevent the user from changing pages without a warning message during a transaction in Progress Smart Objects

FACT(s) (Environment):

Progress 8.x

FIX:

Sometimes, you might want your application to display a warning message to the user at the juncture when they are currently modifying a record and attempting to change pages without first completing the transaction.

In Version 8.X, when the user changes the current page of a multi-paging window, Progress executes a procedure in that window named select-page.  The select-page procedure calls the broker-select-page procedure, which in turn runs the broker-notify procedure, passing "hide" as an input parameter.  

When the code placed into the broker-notify procedure gets executed, it runs another ADM1 procedure in the object(s) that is(are) placed on the current window's page based on the second input parameter that it receives, which is the adm-hide procedure in this case.

With that information in mind, we know that the adm-hide procedure of the SmartViewer that is placed on the current page is run when changing pages.  Therefore, you can customize that procedure by creating its local copy (local-hide) and placing the following statement into its code before the standard behavior:

  /* Code placed here will execute PRIOR to standard behavior. */
 RUN check-modified IN THIS-PROCEDURE("check":U) NO-ERROR.