Skip to content

SAIFMenuTop

SAIFMenuTop renders the top navigation row (top-level application links) and the page action toolbar (Insert/Save/Delete/Edit/Cancel/Submit/Print/Preview/Email/Download/Calculate/Help/ Preferences icons). It derives each toolbar button's visibility and enabled state from the current page's authorised action-capability flags, showing each toolbar button only when the current page enables it (BR-MENU-059), and raises a single ToolbarClick event carrying a ToolBarButton value for the hosting page to handle, rather than performing any action itself (BR-MENU-075).

Purpose

  • Render top-level page links from the user's authorised menu items inside the top menu/app row panel, highlighting the current page's link (BR-MENU-052, BR-MENU-058).
  • Build the page action toolbar so each icon is a registered SAIFImageButton, deriving its visibility from the current page's configuration and applying a client-side one-click guard script to prevent duplicate submits (BR-MENU-053, BR-MENU-061).
  • Raise ToolbarClick with the logical ToolBarButton that was clicked, leaving the actual action to the hosting page, without re-checking the button's visibility or enabled state at click time (BR-MENU-077).
  • Serialize each button's rendered state into clsMenuButton instances kept in view state, so state survives postbacks without re-deriving capability flags every time.*

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
ToolbarClick Public Event ToolbarClick(button As ToolBarButton) Raised when the user clicks a toolbar icon; carries the logical button identity for the hosting page to act on.
SelectedCategory Public Property SelectedCategory As String The menu category currently selected; used to determine which top-row link is highlighted.
HighlightPage Public Property HighlightPage As Boolean Whether the current page's top link should be visually highlighted.
EnableButtonIndicators Public Property EnableButtonIndicators As Boolean Whether toolbar buttons show the AJAX activity indicator/form-disable behaviour on click.
InsertButton Public Property InsertButton As Boolean Explicit override to force-show or force-hide the Insert toolbar button, independent of the derived capability flag.
SaveButton Public Property SaveButton As Boolean Explicit override for the Save toolbar button's visibility.
DeleteButton Public Property DeleteButton As Boolean Explicit override for the Delete toolbar button's visibility.
EditButton Public Property EditButton As Boolean Explicit override for the Edit toolbar button's visibility.
CancelButton Public Property CancelButton As Boolean Explicit override for the Cancel toolbar button's visibility.
SubmitButton Public Property SubmitButton As Boolean Explicit override for the Submit toolbar button's visibility.
PrintButton Public Property PrintButton As Boolean Explicit override for the Print toolbar button's visibility.
PreviewButton Public Property PreviewButton As Boolean Explicit override for the Preview toolbar button's visibility.
EmailButton Public Property EmailButton As Boolean Explicit override for the Email toolbar button's visibility.
DownloadButton Public Property DownloadButton As Boolean Explicit override for the Download toolbar button's visibility.
CalculateButton Public Property CalculateButton As Boolean Explicit override for the Calculate toolbar button's visibility.
HelpButton Public Property HelpButton As Boolean Explicit override for the Help toolbar button's visibility.
PrefsButton Public Property PrefsButton As Boolean Explicit override for the general Preferences toolbar button's visibility.
SetPrefsButton Public Property SetPrefsButton As Boolean Explicit override for the "Set as preference" toolbar button's visibility.
ClearPrefsButton Public Property ClearPrefsButton As Boolean Explicit override for the "Clear preference" toolbar button's visibility.
MenuButtons Public ReadOnly Property MenuButtons As Collection(Of clsMenuButton) The current view-state-backed collection of rendered button state objects, one per toolbar icon.
NavigateToItem Public Sub NavigateToItem(application As String, page As String) Locates the sibling SAIFMenu control (by the fixed ID SAIFMenu1) and forces navigation state to the given application/page.

Behavioral notes

  • GetNavigationData is duplicated verbatim from SAIFMenu rather than shared, so the two controls must be kept in sync manually.*
  • Toolbar button state (visibility, enabled, image, tooltip, access key) is serialized into clsMenuButton instances kept in view state rather than being recomputed on every postback (BR-MENU-054).
  • A disabled button renders a _D image variant and a disabled control instead of being hidden outright (BR-MENU-068).
  • Rendering exceptions are caught and written directly into the page rather than raised, mirroring SAIFMenu's behaviour (BR-MENU-071).

Constraints and usage notes

  • NavigateToItem assumes a sibling control literally named SAIFMenu1 exists on the page; renaming the SAIFMenu instance breaks this integration.**
  • Top link IDs are constructed with a fixed TOP_LB prefix plus the item's sequence number, so hosting pages must not rely on any other ID scheme when locating them programmatically (BR-MENU-057).
  • The hosting page should be castable to SAIF.Presentation.Web.MVC.ViewPageBase, matching the same constraint documented for SAIFMenu (BR-MENU-005).*

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/SAIFMenuTop.vb