EndModal function
Syntax
EndModal(returnvalue)
Description
Use the EndModal function to close a currently open modal or modeless secondary window. It is required only for secondary windows that do not have OK and Cancel buttons. If the secondary window has OK and Cancel buttons, then the function for exiting the window is built in and no additional PeopleCode is required.
Important:
Do not use multiple EndModal or EndModalComponent invocations to close multiple, open modal secondary windows simultaneously. Each modal window must be closed individually with a single EndModal call followed by an event that triggers a trip to the application server. Otherwise, multiple, simultaneous EndModal or EndModalComponent invocations will close all open modal secondary windows.
Parameters
| Parameter | Description |
|---|---|
|
returnvalue |
A number value that determines whether the secondary page data is copied back to the parent page. A positive value runs SaveEdit PeopleCode and copies the data (this is the same as clicking the OK button). A value of zero skips SaveEdit and discards buffer changes made in the secondary page (this is the same as clicking the Cancel button). This value becomes the return value of the DoModal function that started the secondary page, and it can be tested after the secondary page is closed. |
Returns
None.
Example
The following statement acts as an OK button:
EndModal(1);
The following statement acts as a Cancel button:
EndModal(0);
Restrictions on Use With a Component Interface
This function is ignored (has no effect) when used by a PeopleCode program that’s been called by a Component Interface.
Related Topics