Class HtmlErrorDisplayConfig

A configuration object that can be used to configure an HtmlErrorDisplay method call. Also useful for holding error information in Web Connection form processing.

Class Members

MemberDescription

Attributes

Optional additional HTML attributes to be attached to the alert level element.

o.Attributes

Errors

o.Errors

Header

An optional header that is displayed. If setm, the header is displayed in bigger text with the message displayed below.

o.Header

Icon

The alert box type. Corresponds to BootStrap alert themes

  • warning
  • danger
  • info
  • success

Each also displays with its dedicated icon (! for the first two, info, and check).

o.Icon

Message

The message that is displayed in the alert box.

If the message is empty, the alert box is not displayed.

o.Message

Example

Function TimeReport

*** Error display object
poError = CREATEOBJECT("HtmlErrorDisplayConfig")

*** Business object for binding
poReportParms = CREATEOBJECT("ReportParameters")

IF (Request.IsPostBack())
   *** Assign validation errors
   poError.Errors = Request.UnbindFormVars(poReportParms)

   IF (poError.Errors.Count > 0)
   	   poError.Message = poError.Errors.ToHtml()
   	   poError.Header = "Please fix the following form entry errors"
   ELSE
       poError.Message = "Ready to run report."
       poError.Icon = "info"
   ENDIF               
ENDIF

*** Display the template
Response.ExpandScript(Config.cHtmlPagePath + "TimeReport.ttk")

In the template then:

<%= HtmlErrorDisplay(poError) %>

See also:

Class wwHtmlHelpers

© West Wind Technologies, 1996-2024 • Updated: 03/09/16
Comment or report problem with topic