Show/Hide Toolbars

Managing an FVTerm Child iFrame in Javascript

Navigation: Using the FVTermParent Javascript Module > FVTermParent.js Functions and Variables > Internal Methods

OnAlert = function (alertObj, msg, bgColor, fnOnClick, buttons)

Scroll Prev Top Next More

Automatically hooked-up Event.  Called for alerts, message boxes and informational message displays.  If you return a null from this function, the message is handled normally inside the emulation session.  

 

Calls the onalert function if defined

 

 

Parameter

Description

alertObj

Information about the message display--includes the following properties:

alertType: "status", "alert" or "msgbox"

status: The status messages that appear and frequently go away on their own

alert:  An alert message with a single OK button

msgbox:  A message with one or more defined buttons, OK, Yes, No and Cancel are options

index: For type "alert" or "msgbox" the index in the emulation session for this alert

close(): To avoid a javascript memory leak, call this function with true as the parameter when your alert is closed, except when your close method is called with true for "fromSession" parameter.

msg

The text of the message to be displayed

bgColor

The background color of the message as requested by the emulation logic

fnOnClick(buttonText)

Optional completion function which if present must be called when a button is clicked.  For alertType=status, if this parameter is not null, a onclick or onmouseup should be set for the displayed message and set to call this function.  Pass the button text that was clicked for type msgbox -- the parameter is ignored for alert and status alertTypes.

buttons

For type="msgbox" a string if single characters indicating the buttons requested.  If omitted, default is "o".  

 

Create and display the appropriate button for each character found.

 

Characters are:

 

o = OK

y = Yes

n = No

c = Cancel

 

 

Optional Return Object Required Members

Description

close(fromSession

Function called by the emulation session if the session is closing or the alert/msgbox/status should be removed for some other reason--if you use the same name for your method, the fromSession parameter being true can avoid infinite recursion (don't call the alertObj.close() function if this is true)