Causes a client-side alert box to be displayed when the page is finished loading. This method is for use with JSP 4GL targets only.
psPage object
psPage.Alert ( string message {, boolean appendToCurrent } )
Argument |
Description |
---|---|
message |
Message to be displayed in the client-side alert box |
appendToCurrent (optional) |
Indicates whether the passed message should replace any current message (the default) or be appended to the current message |
None
By using the optional argument appendToCurrent and setting its value to true, you can present all validation problems to the user at once.
Calling the Alert method is one way of reporting validation errors. Another way is to place an error message in a Static Text control that you make visible when an error is detected. A third way is to call ReportError.
The first two ways display validation errors to the client. If you want to plug validation errors into the standard error processing mechanism, use ReportError.
Do not use HTML in error messages Do not use HTML for messages you want to display in a client-side alert box, because any HTML tags that you type for the message text will also be visible in the alert box.
This call displays the value of the variable MyVar with the added text in quotes. If another Alert call has been made previously, the optional argument makes sure that both alert messages are displayed:
psPage.Alert (MyVar + " in FirstTime event", true);
return true;