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
Message The message that is displayed in the alert box. If the message is empty, the alert box is not displayed.
o.Message
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
Attributes Optional additional HTML attributes to be attached to the alert level element.
o.Attributes
Errors A collection of wwValidationError objects that contain error information. You most commonly collect values into this object from Request.UnbindFormVars() or wwBusiness::ValidationErrors to display…
o.Errors

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