Skip to content

Render the applications accordion

Build the collapsible, per-category applications accordion trimmed to the user's authorised, visible menu items. This operation is implemented by SAIFMenu.AddLinks.

Field Value
Operation ID OP-MENU-005
Trigger SAIFMenu.AddLinks, invoked from CreateControls during OnLoad, and again when the applications section is expanded.
Inputs ShowApps; NavigationData.MenuAuthorizedItems; SelectedCategory.
Outputs An AjaxControlToolkit.Accordion (UMenu) with one pane per category and a LinkButton per visible item.
Primary components SAIFMenu.AddLinks
Entry point SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenu.vb

Steps

  1. When ShowApps is true, create an AjaxControlToolkit.Accordion (UMenu) 120 pixels wide with header styles applicationitem / application-current, 250 ms transition at 50 frames per second. Enforces BR-MENU-024.
  2. Sort all authorised menu items by MenuCategory then MenuOrder using two SortParm entries and SortMulti. Enforces BR-MENU-025.
  3. Delegates to SAIF.Business.Menu.
  4. For each application item, open a new accordion pane whenever the category code changes — but only if that category contains at least one visible item. Enforces BR-MENU-026, BR-MENU-027.
  5. Reject a pane whose ID is empty, equals _Header, or duplicates an existing pane, by throwing ApplicationException("Bad Menu Pane ID: …"). Enforces BR-MENU-028.
  6. On failure: the exception propagates; no fallback rendering occurs.
  7. For each visible item add a LinkButton (<controlId>_LB<MenuItemSeqNum>) inside a <div class='UMenuli'>, styled applicationitemselected when it is the current page and application-submenu otherwise. Enforces BR-MENU-029, BR-MENU-030.
  8. When SelectedCategory is set, select the matching pane by ID. Enforces BR-MENU-031.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start(["SAIFMenu.AddLinks"]) --> ShowApps{ShowApps true?}
    ShowApps -->|Yes| Create["Create AjaxControlToolkit.Accordion (UMenu), 120px, timed transition"]
    Create --> Sort["Sort authorised items by MenuCategory then MenuOrder"]
    Sort --> Panes["Open new pane per category change (only if category has a visible item)"]
    Panes --> Validate{"Pane ID empty, _Header, or duplicate?"}
    Validate -->|Yes| Throw(["Throw ApplicationException(Bad Menu Pane ID)"])
    Validate -->|No| Links["Add LinkButton per visible item inside UMenuli div"]
    Links --> StyleCurrent["Style applicationitemselected for current page"]
    StyleCurrent --> Select{SelectedCategory set?}
    Select -->|Yes| SelectPane["Select matching pane by ID"]
    Select -->|No| End(["Accordion with one pane per application"])
    SelectPane --> End

Failure and edge-case behavior

  • Duplicate, empty, or _Header-named pane IDs throw ApplicationException (BR-MENU-028).

Sources

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