sendMsg()

Displays a user-response dialog box, which includes a message and requires a response from the user.

Syntax

public int sendMsg(String msg, int dialogFlags);

Parameters

msg
Is the message to display in the user-response dialog box.
dialogFlags
Is a set of flags to indicate the buttons and icons to display as part of the user-response dialog box. Indicate these buttons and icons as a mask of the user-response-dialog constants shown in Table 110.

Return values

An integer that indicates the button that the user has clicked to terminate the user-response dialog box. Compare this integer value with the following user-response constants:

ODKConstant.ODK_OK
The user selected the OK button.
ODKConstant.ODK_CANCEL
The user selected the Cancel button.
ODKConstant.ODK_RETRY
The user selected the Retry button.
ODKConstant.ODK_IGNORE
The user selected the Ignore button.
ODKConstant.ODK_ABORT
The user selected the Abort button.
ODKConstant.ODK_YES
The user selected the Yes button.
ODKConstant.ODK_NO
The user selected the No button.
ODKConstant.ODK_CLOSE
The user selected the Close button.
ODKConstant.ODK_HELP
The user selected the Help button.

Notes

The sendMsg() method sends a request to Business Object Wizard to display a user-response dialog box to the user. You specify the following components of this user-response dialog box:

Table 110. Display appearance of the user-response dialog box
Appearance of user-response dialog box ODKConstant user-response-dialog constant
Buttons to display:
OK MSG_OK
OK, CANCEL MSG_OKCANCEL
RETRY, CANCEL MSG_RETRYCANCEL
RETRY, IGNORE, ABORT MSG_ABORTRETRYIGNORE
YES, NO MSG_YESNO
YES, NO, CANCEL MSG_YESNOCANCEL
dialog box icon to display:
Error icon MSG_ERROR
Critical-error icon MSG_CRITICALERROR
Warning icon MSG_WARNING
Information icon MSG_INFORMATION
Question-mark icon MSG_QUESTION

Note:
All user-response-dialog constants in Table 110 are defined in the ODKConstant interface.

To specify the dialogFlags argument, create a mask of the user-response-dialog constants that describe the appearance of your user-response dialog box. For example, the following call to sendMsg() creates a user-response dialog box that displays an error icon as well as the buttons Retry and Cancel:

String msg = new String(bdkUtil.getMsg(
   1002, ODKConstant.XRD_ERROR, params));
bdkUtil.sendMsg(msg, 
   ODKConstant.MSG_RETRYCANCEL | ODKConstant.MSG_ERROR);

See also

sendStatusMsg()

Copyright IBM Corp. 2004, 2005