Both Windows Affect Each Other |
Assume, one window contains a button that opens another window by performing a Window.Create() call. The window that contains the button is the calling window, and the window that is opened is the created window. After creation, both windows can affect each other; a two-way window interaction can be set up. To set up a two-way window interaction:
Example 1 Suppose, the calling Bookings window opens the to be created Days window. For the Bookings window, define a user-defined property UDPDays of type: Days.
user-defined-property( created-window( Self() ).Window.Create() )
•Sends the calling window as value to the user-defined property of the created window, within the Self() keyword. •Implicitly opens the to be created window. •Fills the <UDPCreated> user-defined property with the created window.
UDPDays( Days( Self() ).Window.Create() )
Example 2 To set the background color of the Days window to red, insert a button in the Bookings window, and set the Action property to: UDPDays.background( red )
To set the background color of the Bookings window to red, insert a button in the Days window, and set the Action propre to: UDPBookings.background( red )
CAUTION: In this situation, if the user closes one of the two windows, the other window still contains a reference to the closed window in its user-defined property. To deal with this, refer to help topic: "Clearing the Reference To a Closed Window".
See Also |