Display a status message¶
Display a status/validation message with an icon selected from message-text keywords. ASP.NET page lifecycle (Init, CreateChildControls, RenderControl) for a SAIFMessage instance.
| Field | Value |
|---|---|
| Operation ID | OP-V2-006 |
| Trigger | ASP.NET page lifecycle (Init, CreateChildControls, RenderControl) for a SAIFMessage instance. |
| Inputs | Text, DisplayImage (SAIFMessage.Images). |
| Outputs | A one-row HTML table containing a status icon and a label. |
| Primary components | SAIFMessage |
| Entry point | SAIF.Presentation.Web.Controls.V2/SAIFMessage.vb |
Steps¶
- On
Init, register theMessage.jsclient script include from/Resources/Scripts/Controls/Message.jsunless already registered. (BR-V2-037) - On
CreateChildControls, add the message image (SAIFMessageImage) and the message label (lblSAIFMessage, CSS classsaifmsg), marking the image as not enableable by the control manager viaUtilities.SetControlManagerEnableable. (BR-V2-038, BR-V2-039) -
Origin: This step delegates to
Utilities.mdlUtilities.SetControlManagerEnableable(this library, see Control-manager enableability helpers). - On
RenderControl, emit a one-row table; in design mode force the "complete" icon. (BR-V2-040) - At run time, add attribute
IsImageSet=falseand a hidden display style when the text is empty, otherwiseIsImageSet=true, then select the icon. (BR-V2-041) - Icon selection: if
DisplayImageisDefaultImage, chooseMsgError.pngfor text containingerror:,MsgWarning.pngforwarning:, the complete image forcomplete:,MsgComplete.pngfor the exact textchanges saved., andMsgWarning.pngotherwise; then strip allcomplete:occurrences from the text. (BR-V2-042, BR-V2-043, BR-V2-044, BR-V2-045, BR-V2-046) - Render image, label and closing tags.
- On failure: write the exception message, source and stack trace to the output stream.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([RenderControl]) --> Design{Design mode?}
Design -->|Yes| Complete[Force complete icon]
Design -->|No| Empty{Text empty?}
Empty -->|Yes| Hide["IsImageSet=false, hidden style"]
Empty -->|No| Keyword[Select icon by keyword]
Keyword --> Strip["Strip complete: from text"]
Complete --> Render[Render image + label]
Hide --> Render
Strip --> Render
Render -->|Exception| ErrOut([Write exception detail])
Render --> Done([Rendered])
Failure and edge-case behavior¶
- On failure: write the exception message, source and stack trace to the output stream.
Related documentation¶
Note: Statements marked with
*were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with**could not be confirmed; treat as unknown until verified.
Sources¶
SAIF.Presentation.Web.Controls.V2/SAIFMessage.vb