asp.net.ph

Skip Navigation Links

showModelessDialog Method

DHTML Methods


Creates a modeless dialog box.

Syntax

vReturnValue = window.showModelessDialog ( 
   sURL  [ ,  vArguments ]  [ ,  sFeatures ] ) 
Parameters

sURL Required. String specifying the URL of the document to load and display.
vArguments Optional. Variant specifying the arguments to use when displaying the document. This parameter can be used to pass a value of any type, including an array of values. The dialog can extract the values passed by the caller from the dialogArguments property of the window object.
sFeatures Optional. String specifying the window ornaments for the dialog box. It can be a combination of the following values:

dialogHeight:iHeight Sets the height, in pixels, of the dialog window.
dialogLeft:iXPos Sets the left position of the dialog window relative to the upper-left corner of the desktop.
dialogTop:iYPos Sets the top position of the dialog window relative to the upper-left corner of the desktop.
dialogWidth:iWidth Sets the width, in pixels, of the dialog window.
center:{ yes | no | 1 | 0 } Specifies whether to center the dialog window within the desktop. The default is yes.
help:{ yes | no | 1 | 0 } Specifies whether the dialog box should display the context-sensitive Help icon. The default is yes.
resizable:{ yes | no | 1 | 0 } Specifies whether the dialog window will be of set dimensions. The default for both trusted and untrusted dialogs is no.
status:{ yes | no | 1 | 0 } Specifies whether the dialog window will display a status bar. The default is yes for untrusted dialogs and no for trusted dialogs.


Return Value

Returns a reference to the new window object. Use this reference to script properties and methods on the new window.

Remarks

The showModelessDialog method is useful for menus and Help systems. When the method is invoked, a dialog box displays that is layered in front of the browser window or HTML Application ( HTA ). The modeless dialog box displays even when the user switches input focus to the window.

By convention, modeless dialog boxes can differ from an application window in that they have neither scroll bar, status bar, nor resize capability. To achieve this type of dialog box, implement the following steps:

  • Turn off the scroll bar. Make use of the SCROLL attribute by including scroll="no" in the BODY tag for the dialog window.
  • Turn off the status bar. Set the value of status to no in the sFeatures parameter of the showModelessDialog call. A second option is to call the dialog from a trusted application, such as Microsoft Visual Basic® or an HTA, or from a trusted window, such as a trusted dialog box. These are considered trusted because they use Internet Explorer® interfaces instead of the browser. Any dialog box generated from a trusted source will have the status bar off by default.
  • Do not allow resizing. Resizing is off by default.

Create a return value for showModalDialog by passing in a callback function or an object from the calling document. To accomplish this task, set the vArguments parameter in the showModelessDialog call to the callback function or object. In the modeless dialog box, you will be able to reference this function or object through the dialogArguments property of the window object. The same arguments are valid for the showModelessDialog and showModalDialog methods.

The default font settings should be set in the same way CSS attributes are set, for example, "font:3; font-size:4". Use multiple font attributes when defining multiple font values.

When dialogLeft and/or dialogTop is specified, center is overridden, although the default for center is yes.

Example

The example demonstrates several aspects of modeless dialog implementation. It shows how to create a return value when invoking the showModelessDialog method. In addition, the sample illustrates ways to handle user actions in the modeless dialog box. Click the Show Me button to access the full code sample.

Sample Code


Applies To

window



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note