Message icon selection¶
This operation determines which status icon (Error/Warning/Complete) SAIFMessage displays, based on keyword scanning of the message text, unless the caller has explicitly overridden the icon.
| Field | Value |
|---|---|
| Operation ID | OP-V2-MSG-001 |
| Trigger | Text property set with content containing "Error:", "Warning:", "Complete:", or "changes saved.". |
| Inputs | Text content; DisplayImage property (if explicitly set by caller). |
| Outputs | DisplayImage/_img.ImageUrl selection; "Complete:" keyword text stripped from the displayed message via regex. |
| Primary components | SAIFMessage.SetImage, called from SAIFMessage.RenderControl. |
| Entry point | SAIF.Presentation.Web.Controls.V2\SAIFMessage.vb |
Steps¶
RenderControlcallsSetImagebefore rendering the image and label. (BR-V2-005)SetImagechecksDisplayImage; if it has not been explicitly overridden (= Images.DefaultImage), it scansText(case-insensitive) in this order:- Contains
"error:"→ sets image to the error icon (MsgError.png). - Contains
"warning:"→ sets image to the warning icon (MsgWarning.png). - Contains
"complete:"→ setsDisplayImage = Images.CompleteImageand updates the alternate text. - Exact match
"changes saved."/"changes saved. <br>"→ sets image to the complete icon (MsgComplete.png). - Otherwise → defaults to the warning icon.
- After the keyword scan, any
"complete:"occurrence inTextis stripped via a case-insensitive regex replace, so the keyword itself never displays to the user.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([RenderControl invoked]) --> Check{DisplayImage overridden?}
Check -->|Yes| Skip([Use caller-supplied image])
Check -->|No| Scan[Scan Text for keywords]
Scan --> Error{Contains error:}
Error -->|Yes| ErrImg([Error icon])
Error -->|No| Warn{Contains warning:}
Warn -->|Yes| WarnImg([Warning icon])
Warn -->|No| Complete{Contains complete:}
Complete -->|Yes| CompImg[Complete icon, strip keyword text]
Complete -->|No| Saved{Exact match changes saved.}
Saved -->|Yes| CompImg2([Complete icon])
Saved -->|No| DefaultImg([Default: warning icon])
Failure and edge-case behavior¶
- This is a UI convention for auto-selecting status iconography by message-text keyword, not a business rule about application data.
- The client-side
Message.jsscript referenced for postback re-rendering is not present in this project folder; its exact behavior could not be verified from this library's source**.
Note: Statements marked with ** could not be confirmed; treat as unknown until verified.
Related documentation¶
Sources¶
- SAIF.Presentation.Web.Controls.V2\SAIFMessage.vb