Kbase 15767: How to Change Pages on a SmartWindow from a SmartObject
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to Change Pages on a SmartWindow from a SmartObject
Generally to change pages on a SmartWindow you run the
select-page method, passing the page you wish to change to
as an argument - e.g. run select-page(0). SmartObjects
that are contained within a SmartWindow are independent of
each other. You can't compile a SmartObject master with
any reference to other SmartObjects because they aren't
known at design time.
To change the page from a SmartObject to the containing
Window you need to find the handle of the Window. You can
use ADM-BROKER-HDL procedures to obtain handles to other
SmartObjects. You have to retrieve them indirectly
through the ADM Broker.
The following example consists of a SmartBrowse on page 2
of a SmartWindow. On double click of the SmartBrowse we
wish to return to page 0 of the SmartWindow. Here we use
GET-LINK-HANDLE to retrieve the CONTAINER-SOURCE for the
SmartObject. The handle is saved in a variable called
h_handle.
The trigger code in the SmartBrowse master would look as
follows:
ON mouse-select-dbclick OF br_table
DO:
DEF VAR h_handle AS HANDLE NO-UNDO.
DEF VAR ch AS CHAR NO-UNDO.
RUN GET-LINK-HANDLE IN ADM-BROKER-HDL
(INPUT THIS-PROCEDURE,
INPUT 'CONTAINER-SOURCE', OUTPUT ch).
h_handle = WIDGET-HANDLE(ch).
RUN SELECT-PAGE IN h_handle(0).
END.
Progress Software Technical Support Note # 15767