Prepare and render the toolbar¶
Synchronise each toolbar icon's rendered image/access-key/tooltip from its logical button model, then render the navigation and toolbar markup in a fixed order. This operation is implemented by SAIFMenuTop.OnPreRender, SAIFMenuTop.RenderControl.
| Field | Value |
|---|---|
| Operation ID | OP-MENU-014 |
| Trigger | SAIFMenuTop.OnPreRender followed by RenderControl during the ASP.NET render phase. |
| Inputs | clsMenuButton state per icon; EnableButtonIndicators; browser user agent (for Firefox detection). |
| Outputs | Rendered navigation and toolbar markup; client-side one-click/indicator attributes. |
| Primary components | SAIFMenuTop.OnPreRender, SAIFMenuTop.RenderControl |
| Entry point | SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenuTop.vb |
Steps¶
OnPreRenderwalks the toolbar panel and, for each icon with a matchingclsMenuButton, applies the button's image URL, access key and tooltip when they differ from the rendered values. Enforces BR-MENU-062.- Tooltips gain an access-key prefix of
Alt+, orShift+Alt+when the browser is Firefox 2 or later. Enforces BR-MENU-063. - When
EnableButtonIndicatorsis true, each icon enables the activity indicator and form-disable behaviour; otherwise indicators are off and one-click buttons receive anonclick="javascript:mnuOneClickOnly(this);"attribute. Enforces BR-MENU-064, BR-MENU-065. RenderControlrenders the navigationdiv, then — only when at least one toolbar button is visible — opens the toolbardiv. Enforces BR-MENU-066.- Render the right-hand icon span (default-submit, help, preference save/clear), each icon only when its logical button is visible, calling
DisableIconfirst when the button is disabled. Enforces BR-MENU-067, BR-MENU-068. - Render the insert/save/delete/edit/cancel/submit group when any of them is visible, followed by the pipe separator image, then the print/preview/email/download/calculate group. Enforces BR-MENU-069, BR-MENU-070.
-
- On failure: any exception during toolbar rendering is caught and its message, source and stack trace are written into the page. Enforces BR-MENU-071.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["SAIFMenuTop.OnPreRender"]) --> Sync["Sync each icon's image URL, access key and tooltip from clsMenuButton"]
Sync --> Prefix["Prefix tooltip access key with Alt+ (Shift+Alt+ for Firefox 2+)"]
Prefix --> Indicator{EnableButtonIndicators?}
Indicator -->|Yes| Enable["Enable activity indicator and form-disable per icon"]
Indicator -->|No| OneClick["Add onclick=mnuOneClickOnly(this) to one-click buttons"]
Enable --> Render["RenderControl: render navigation div"]
OneClick --> Render
Render --> ToolbarDiv{Any toolbar button visible?}
ToolbarDiv -->|Yes| OpenDiv["Open toolbar div"]
OpenDiv --> RightIcons["Render right-hand icon span (default-submit, help, pref save/clear)"]
RightIcons --> Groups["Render insert/save/delete/edit/cancel/submit group, pipe separator, print/preview/email/download/calculate group"]
Groups --> End(["Rendered navigation and toolbar markup"])
Render -.->|Exception| ErrPage(["Message, source, stack trace written into page"])
Failure and edge-case behavior¶
- Any unhandled rendering exception: caught and the message, source, and full stack trace are written directly into the page output (BR-MENU-071) — an information-disclosure risk.
Related documentation¶
Sources¶
SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenuTop.vb