Kbase P46848: When consecutively opening 2 child windows user can work only in the last one, the first one just f
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  08/06/2004 |
|
Status: Unverified
FACT(s) (Environment):
Progress 9.1D
SYMPTOM(s):
When consecutively opening 2 child windows user can work only in the last one, the first one just flashes on the screen.
Application built in ADM1
Child windows as stored in main window in different pages and called with RUN select-page(N)
CAUSE:
This is expected behaviour.
FIX:
Avoid using:
RUN SELECT-PAGE(1).
RUN SELECT-PAGE(2).
In ADM1 a select-page call will hide the current page and show the desire page.
It is expected to see the last selected page when making consecutive select-page calls.
To avoid this situation select the first page only and let the child container/window to call the next page.
i.e. When closing the first child window/container make your code
retrive the SOURCE-CONTAINER handle and run select-page(next-page) in hParent.
Something like:
DEF VAR hParent AS HANDLE.
DEF VAR vcTemp AS CHARACTER.
RUN get-link-handle
IN adm-broker-hdl
(THIS-PROCEDURE:HANDLE, 'CONTAINER-SOURCE':U, OUTPUT vcTemp ) .
hParent = WIDGET-HANDLE( vcTemp ).
IF VALID-HANDLE( hParent ) THEN DO:
MESSAGE "Now I am open page 2." skip PROGRAM-NAME(1) .
RUN select-page IN hParent (2) .
END.
If your business logic requires to open 1st page then 2nd page no matter if 1st page was opended then check the current page before going to 2nd page:
IF something THEN RUN select-page(1).
DEF VAR viPage AS INTEGER.
RUN get-attribute IN THIS-PROCEDURE ('CURRENT-PAGE':U).
viPage = INTEGER( RETURN-VALUE ).
IF viPage NE 1 THEN RUN select-page(2).
/* that's it 1st page will open 2nd page */