wwProcess::ErrorMsg

This method is a simple way to create a fully self contained HTML page with just a couple of lines of code. This is great for testing output or error messages that let the user know of certain problems with the application.

This method also supports auto refresh of the Web page to go to another URL after a number seconds.

This method is implemented identical as the StandardPage method of this class. There are two separate versions to allow for two kinds of status pages to be displayed so error can look different than successful response pages. To customize these methods simply reimplement the methods in your subclass of wwProcess.

You can also override this method with a custom template by specifying a template file path in the cErrorTemplate property. When set the template is used instead of the hardcoded ErrorMsg method code.

o.ErrorMsg(lcHeader, lcBody, lvHeader, lnRefresh, lcRefreshUrl, lcIcon)

Return Value

nothing

Parameters

lcHeader
The header of the message. This is bolder at the top of the page and also reflects in the browser's title bar.

lcBody
The body of the message. This text can contain plain text or HTML.

lvHeader
Optional. The content type or HTTP Header object for this page. You can create a custom header with the wwHTTPHeader class or pass an HTTP content type.

lnRefresh
Optional - If you would like the page to refresh itself after a while to go to this or another URL you can specify an interval in seconds.

lcRefreshUrl
Optional - Specify the URL that you want to go to when you refresh the page automatically.

lcIcon
Optional - A FontAwesome icon name that is displayed next to the header. Defaults to warning.

Remarks

Although this class is an output method, which typically should belong to the Response object (which has this same identical method BTW), this class is implemented here to allow you to easily subclass the method for custom display formatting, which you will most likely perform on this method. Since wwProcess is always subclassed and wwResponse almost never this was a logical compromise to provide an easier inheritance implementation.


See also:

Class wwProcess | wwProcess::StandardPage | wwProcess::cErrorTemplate

© West Wind Technologies, 1996-2024 • Updated: 08/24/15
Comment or report problem with topic