Skip to content

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

  1. Capture m_Page.ViewID. Enforces BR-MENU-036.
  2. If the current page is not cached, resolve it with NavigationData.GetCurrentPage(). Enforces BR-MENU-039.
  3. Delegates to NavigationContext (which reads menu authorisation data from Oracle).
  4. On a non-postback, make each toolbar button visible and enabled only when the corresponding clsMenuAuthorizedItem flag is set: IsDisplayInsert, IsDisplaySave, IsDisplayDelete, IsDisplayPrint, IsDisplayDownload, IsDisplaySavePreferences, IsDisplayHelp. Enforces BR-MENU-059.
  5. Copy the page-defined tooltips onto the print, insert, save, delete and download buttons. Enforces BR-MENU-060.
  6. Register the one-click guard scripts (mnuWasClicked flag and mnuOneClickOnly function), 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.

Sources

  • SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenuTop.vb