Skip to content

SAIFMenu

SAIFMenu is the left-hand navigation control for the Business Online application: it owns the context search box, the favourites list, and a collapsible per-category applications accordion. It sources every rendered link from the signed-in user's authorised menu items (NavigationContext.MenuAuthorizedItems, session-cached under Session("navdata")), casts the hosting page to SAIF.Presentation.Web.MVC.ViewPageBase to key session/view-state entries by ViewID, and persists the user's expand/collapse choice through SAIF.Presentation.clsPreferences. It never navigates itself: clicking a link raises MenuNavigate for the hosting page to act on, except the "Change Password" link, which redirects directly for external clients (BR-MENU-023, BR-MENU-044).

Purpose

  • Render a context search textbox with three display modes (normal, read-only, hidden) and watermark/placeholder behaviour, notifying the host page of changes via OnContextChanged (BR-MENU-011–BR-MENU-017).
  • Render the user's favourites list, trimmed to authorised items and ordered by MenuOrder, with an optional self-service "Change Password" link for external clients (BR-MENU-019, BR-MENU-023).
  • Build and manage a collapsible AjaxControlToolkit.Accordion of application categories and links, trimmed to the user's authorised, visible items (BR-MENU-024–BR-MENU-031).
  • Resolve menu link clicks back to an authorised menu item and raise MenuNavigate for the hosting page, rather than navigating directly (BR-MENU-046, BR-MENU-047).
  • Persist and restore the user's "show applications pane" layout choice (SHOWAPPS) via SAIF.Presentation.clsPreferences (BR-MENU-035).

Context

  • Namespace: SAIF.Presentation.Web.Controls.V2.Menu
  • Assembly/package: SAIF.Presentation.Web.Controls.V2.Menu (shipped merged into SAIF.Presentation.Web.Infragistics111.dll via ILMerge)

Public members

Member Signature Purpose
OnContextChanged Public Event OnContextChanged(oldValue As String, newValue As String) Notifies the host page whenever the context search value changes, carrying both the previous and new values.
MenuNavigate Public Event MenuNavigate(application As String, page As String) Raised whenever a favourite or application link is clicked; carries the resolved authorised item's application path and page link for the host page to act on.
DefaultOnSubmit Public Event DefaultOnSubmit() Raised when the hidden default-submit button is triggered (e.g., by pressing Enter outside the context box), letting the host page define its own Enter-key behaviour.
DisplayChangePW Public Property DisplayChangePW As Boolean Controls whether the "Change Password" favourite link can be shown at all, in addition to the external-client gate.
ShowApps Public Property ShowApps As Boolean Whether the applications accordion is currently expanded; drives both rendering and the persisted SHOWAPPS preference.
SelectedCategory Public Property SelectedCategory As String The menu category currently selected; determines which accordion pane opens and which top-row links SAIFMenuTop shows.
MaxContextValueLength Public Property MaxContextValueLength As Integer Maximum character length accepted by the context search textbox.
UpperCaseContextValue Public Property UpperCaseContextValue As Boolean When true, forces the value returned by ContextValue to upper case.
ContextViewStyle Public Property ContextViewStyle As ContextViewStyleEnum Selects whether the context box renders editable, read-only, or hidden.
ContextLabel Public Property ContextLabel As String Watermark/placeholder text shown in the context box when it is empty.
ContextValue Public Property ContextValue As String The user-entered (or watermark-suppressed) search value; setting it raises OnContextChanged with the old and new values.
HighlightPage Public Property HighlightPage As Boolean Whether the current page's favourite/application link should be visually highlighted.
DefaultSubmitButton Public Property DefaultSubmitButton As String The control ID that should act as the default submit target when Enter is pressed.
getImageButton Public Function getImageButton(logicalName As String) As SAIFImageButton Resolves the rendered SAIFImageButton instance for a logical menu icon name, letting host pages further customize a specific icon.

Behavioral notes

  • GetNavigationData is duplicated verbatim in SAIFMenuTop rather than shared, so the two controls must be kept in sync manually.*
  • The left menu control tree is fully rebuilt on every page load rather than cached across postbacks (BR-MENU-007).
  • Rendering exceptions are caught and their message, source, and stack trace are written directly into the page rather than raised (BR-MENU-071), an information-disclosure risk in production.

Constraints and usage notes

  • The hosting page should be (or be castable to) SAIF.Presentation.Web.MVC.ViewPageBase; when it is not, m_Page is Nothing and ViewID-based session/view-state keys fall back to an empty string (BR-MENU-005).*
  • SAIFMenuTop.NavigateToItem locates the left menu by the literal control ID SAIFMenu1; hosting pages should not rename the SAIFMenu instance.**
  • Preference persistence (SHOWAPPS) requires the authenticated identity to be in DOMAIN\user form; otherwise preference read/write is silently skipped (BR-MENU-043).

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

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