DoModalX function

Syntax

DoModalX(showInModal, cancelButtonName, Page.pagename, title, xpos, ypos[, level, scrollpath, target_row])

In which scrollpath is:

[Record.level1_recname, level1_row, [Record.level2_recname, level2_row, ]] Record.target_recname

To prevent ambiguous references, you can also use Scroll. scrollname, in which scrollname is the same as the scroll level’s primary record name.

Description

Use the DoModalX function to display a secondary page modally when you do not want it to display in a modal, secondary window. Instead, the page to be displayed completely replaces the primary window when the showInModal parameter is set to False. Similar to DoModal, the user must complete work on the secondary page before continuing work in the page from which the secondary page was called.

Important:

Use the DoModalX and DoModalXComponent functions in classic applications only, either in a standalone classic application or when classic components are included in fluid activity guide and master/detail wrappers. See Fluid User Interface Developer’s Guide: Transfer and Modal Functions for more information on which functions are available for which purposes.

Important:

When the showInModal parameter is set to False, using DoModalX will completely replace the primary window, even if DoModalX is called from a modal window. In addition, this will also close any open modal windows. Therefore, Oracle recommends that DoModalX with the showInModal parameter set to False not be used after calling DoModal or DoModalComponent, or after calling DoModalX or DoModalXComponent when the showInModal parameter is set to True.

DoModalX can display a single page modally. To display an entire component modally, use DoModalXComponent. Any variable declared as a component variable will still be defined after calling the DoModalX function. If you call DoModalX without specifying a level number or any record parameters, the function uses the current context as the parent.

When you use the DoModalX function in component PreBuild or PostBuild PeopleCode event, do not use browser refresh to reload a page because the browser will throw an error.

See Application Designer Developer’s Guide: Using Secondary Pages.

Parameters

Parameter Description

showInModal

Specify a Boolean value to indicate whether to display the secondary page in a modal, secondary window:

  • True display the page in a secondary, modal window similar to the function of DoModal

  • False do not display the page in a secondary window; instead, completely replace the primary window.

cancelButtonName

Currently, this parameter is not used and should be specified as an empty string: “”.

pagename

The name of the secondary page.

title

The text that displays in the caption of the secondary page.

xpos

The pixel coordinates of the top left corner of the secondary page, offset from the top left corner of the parent page (the default of -1, -1 means centered).

ypos

The pixel coordinates of the top right corner of the secondary page, offset from the top right corner of the parent page (the default of -1, -1 means centered).

level

Specifies the level of the scroll level on the parent page that contains the row corresponding to level 0 on the secondary page.

scrollpath

A construction that specifies a scroll level in the component buffer.

target_row

The row number of the row in the parent page corresponding to the level 0 row in the secondary page.

Returns

Returns a number that indicates how the secondary page was terminated. A secondary page can be terminated by the user clicking a built-in OK or Cancel button, or by a call to the EndModal function in a PeopleCode program. In either case, the return value of DoModalX is one of the following:

  • 1 if the user clicked OK in the secondary page, or if 1 was passed in the EndModal function call that terminated the secondary page.

  • 0 if the user clicked Cancel in the secondary page, or if 0 was passed in the EndModal function call that terminated the secondary page.

Example

DoModalX( False, "", Page.EDUCATION_DTL, MsgGetText(1000, 167, "Education Details - %1", EDUCATN.DEGREE), - 1, - 1, 1, Record.EDUCATN, CurrentRowNumber());

Restrictions on Use in PeopleCode Events

Control does not return to the line after DoModalX until after the user has dismissed the secondary page. This interruption of processing makes DoModalX a “think-time” function, which means that it shouldn’t be used in any of the following PeopleCode events:

  • SavePreChange.

  • SavePostChange.

  • Workflow.

  • RowSelect.

  • Any PeopleCode event that executes as a result of a ScrollSelect, ScrollSelectNew, RowScrollSelect, or RowScrollSelectNew function call.

  • Any PeopleCode event that executes as a result of a Rowset class Select method or SelectNew method.

  • You should not use DoModalX or any other think-time function in FieldChange when the field is associated with an edit box, long edit box, or drop-down list box. Use FieldEdit instead.

    However, DoModalX can be used in FieldChange when the field is associated with a push button, radio button, check box, or hyperlink.

In addition, you can't use DoModalX in the SearchInit event.

See PeopleCode Developer’s Guide: Think-Time Functions.

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.