Restore menu state on page pre-load¶
Re-establish the left menu's session-scoped state (expanded/collapsed, current page, context value) at the start of each page life cycle. This operation is implemented by SAIFMenu.Page_PreLoad.
| Field | Value |
|---|---|
| Operation ID | OP-MENU-007 |
| Trigger | SAIFMenu.Page_PreLoad, subscribed via the ViewPageBase.PreLoad event. |
| Inputs | m_Page.ViewID; IsPostBack; authenticated identity; stored SHOWAPPS preference; Session("CVTextBox" & ViewID). |
| Outputs | ShowApps state; cached CurrentPage; restored ContextValue. |
| Primary components | SAIFMenu.Page_PreLoad |
| Entry point | SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenu.vb |
Steps¶
- Capture
m_Page.ViewID(or empty string when the page is not aViewPageBase). Enforces BR-MENU-036. - On a non-postback with an authenticated identity, read
SHOWAPPSatPrefScope.AppLeveland setShowAppsaccordingly, defaulting to expanded when the preference is absent. Enforces BR-MENU-037, BR-MENU-038. - Delegates to
clsPreferences(SAIF.Presentation). - If the current page is not yet cached in view state, resolve it via
NavigationData.GetCurrentPage(). Enforces BR-MENU-039. - Delegates to
NavigationContext. - On a non-postback, restore the context value from
Session("CVTextBox" & ViewID)when present. Enforces BR-MENU-040.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start(["SAIFMenu.Page_PreLoad, subscribed via ViewPageBase"]) --> Capture["Capture m_Page.ViewID (empty if not ViewPageBase)"]
Capture --> PostBack{Non-postback and authenticated?}
PostBack -->|Yes| ReadPref["Read SHOWAPPS at PrefScope.AppLevel, default expanded"]
ReadPref --> Restore["Restore context value from Session("CVTextBox" & ViewID)"]
PostBack -->|No| Cached{Current page cached in view state?}
Restore --> Cached
Cached -->|No| Resolve["NavigationData.GetCurrentPage()"]
Cached -->|Yes| End(["ShowApps state; cached current page; restored context"])
Resolve --> 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/SAIFMenu.vb