Skip to content

Render favourites

Render the favourites list — the user's pinned pages plus, for external clients, a self-service password-change link. This operation is implemented by SAIFMenu.AddFavorites.

Field Value
Operation ID OP-MENU-004
Trigger SAIFMenu.AddFavorites, invoked from CreateControls during OnLoad.
Inputs NavigationData.MenuAuthorizedItems.Favorites; AppGlobal.EnvironmentService.IsClientExternal; current item.
Outputs One LinkButton per favourite, wired to LinkButtonClick; an optional ChangePWLink.
Primary components SAIFMenu.AddFavorites
Entry point SAIF.Presentation.Web.Controls.V2.Menu/SAIFMenu.vb

Steps

  1. In design mode, emit three placeholder favourite links (Favorite 1–3). Enforces BR-MENU-018.
  2. At run time, take NavigationData.MenuAuthorizedItems.Favorites and, when non-empty, sort it by MenuOrder. Enforces BR-MENU-019.
  3. Delegates sorting to clsMenuAuthorizedItemCollection in SAIF.Business.Menu.
  4. For each favourite create a LinkButton with ID <controlId>fav_LB<MenuItemSeqNum>, tooltip <MenuCategory> - <ToolTip> and text FavoritePageName, wired to LinkButtonClick. Enforces BR-MENU-020, BR-MENU-021.
  5. Style the link favoriteitem-selected when its MenuPageSeqNum matches the current item; otherwise favoriteitem. Enforces BR-MENU-022.
  6. If AppGlobal.EnvironmentService.IsClientExternal is true, append a "Change Password" link. Enforces BR-MENU-023.
  7. Delegates to the SAIF framework environment service.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start(["SAIFMenu.AddFavorites"]) --> Design{Design mode?}
    Design -->|Yes| Placeholders(["Emit placeholder favourite links 1-3"])
    Design -->|No| Sort["Take MenuAuthorizedItems.Favorites, sort by MenuOrder if non-empty"]
    Sort --> Create["Create LinkButton &lt;controlId&gt;fav_LB&lt;MenuItemSeqNum&gt;"]
    Create --> Tooltip["Set tooltip MenuCategory - ToolTip, text FavoritePageName"]
    Tooltip --> Wire["Wire to LinkButtonClick"]
    Wire --> Style["Style favoriteitem-selected when matching current item"]
    Style --> External{IsClientExternal?}
    External -->|Yes| ChangePw["Append Change Password link"]
    External -->|No| End(["One LinkButton per favourite"])
    ChangePw --> End

Failure and edge-case behavior

  • No exceptional failure paths beyond those noted in the steps above.

Sources

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