Derive toolbar button visibility from the current page¶
Gate each toolbar button's visibility, enabled state, and tooltip on the current authorised page's action-capability flags. This operation is implemented by SAIFMenuTop.Page_PreLoad.
| Field | Value |
|---|---|
| Operation ID | OP-MENU-013 |
| Trigger | SAIFMenuTop.Page_PreLoad, subscribed via the ViewPageBase.PreLoad event. |
| Inputs | m_Page.ViewID; NavigationData.GetCurrentPage(); IsPostBack. |
| Outputs | Updated Visible/Enabled/ToolTip on each toolbar clsMenuButton; registered one-click guard scripts. |
| Primary components | SAIFMenuTop.Page_PreLoad |
| Entry point | SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenuTop.vb |
Steps¶
- Capture
m_Page.ViewID. Enforces BR-MENU-036. - If the current page is not cached, resolve it with
NavigationData.GetCurrentPage(). Enforces BR-MENU-039. - Delegates to
NavigationContext(which reads menu authorisation data from Oracle). - On a non-postback, make each toolbar button visible and enabled only when the corresponding
clsMenuAuthorizedItemflag is set:IsDisplayInsert,IsDisplaySave,IsDisplayDelete,IsDisplayPrint,IsDisplayDownload,IsDisplaySavePreferences,IsDisplayHelp. Enforces BR-MENU-059. - Copy the page-defined tooltips onto the print, insert, save, delete and download buttons. Enforces BR-MENU-060.
- Register the one-click guard scripts (
mnuWasClickedflag andmnuOneClickOnlyfunction), each once per page. Enforces BR-MENU-061.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["SAIFMenuTop.Page_PreLoad, subscribed via ViewPageBase"]) --> Capture["Capture m_Page.ViewID"]
Capture --> Cache{Current page cached?}
Cache -->|No| Resolve["NavigationData.GetCurrentPage()"]
Cache -->|Yes| PostBack{Postback?}
Resolve --> PostBack
PostBack -->|No| Flags["Set Visible/Enabled from clsMenuAuthorizedItem flags"]
Flags --> Tooltips["Copy page-defined tooltips onto toolbar buttons"]
Tooltips --> Guard["Register one-click guard scripts once per page"]
Guard --> End(["Updated Visible/Enabled/ToolTip on each toolbar button"])
PostBack -->|Yes| End
Failure and edge-case behavior¶
- No exceptional failure paths beyond those noted in the steps above.
Related documentation¶
Sources¶
SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenuTop.vb