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¶
- When
ShowAppsis true, create anAjaxControlToolkit.Accordion(UMenu) 120 pixels wide with header stylesapplicationitem/application-current, 250 ms transition at 50 frames per second. Enforces BR-MENU-024. - Sort all authorised menu items by
MenuCategorythenMenuOrderusing twoSortParmentries andSortMulti. Enforces BR-MENU-025. - Delegates to
SAIF.Business.Menu. - 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.
- Reject a pane whose ID is empty, equals
_Header, or duplicates an existing pane, by throwingApplicationException("Bad Menu Pane ID: …"). Enforces BR-MENU-028. - On failure: the exception propagates; no fallback rendering occurs.
- For each visible item add a
LinkButton(<controlId>_LB<MenuItemSeqNum>) inside a<div class='UMenuli'>, styledapplicationitemselectedwhen it is the current page andapplication-submenuotherwise. Enforces BR-MENU-029, BR-MENU-030. - When
SelectedCategoryis 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 throwApplicationException(BR-MENU-028).
Related documentation¶
Sources¶
SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenu.vb