Skip to content

Manage tabs

Add, select, style, sort, and persist a collection of navigation tabs. Host page calls AddTab/InsertTab; CreateChildControls for SAIFTabBar; postback for view-state persistence.

Field Value
Operation ID OP-V2-011
Trigger Host page calls AddTab/InsertTab; CreateChildControls for SAIFTabBar; postback for view-state persistence.
Inputs Tab text, client ID, div ID, selected/enabled/visible flags, access key, width, Mode.
Outputs An ordered tab collection, rendered tab links/bar, and selection change events.
Primary components SAIFTabs / SAIFTabBar
Entry point SAIF.Presentation.Web.Controls.V2/SAIFTabs.vb

Steps

  1. SAIFTabs.AddTab / InsertTab create a TabSettings entry (text, client ID, div ID, selected, access key, width, visible, index) and append or insert it into the tab list. (BR-V2-066, BR-V2-067)
  2. When the added tab is selected, capture the prior selected tab and raise SelectedIndexChanged with a SAIFTabEventArgs carrying both tabs. (BR-V2-068)
  3. SelectedTab returns the first tab whose Selected flag is set, or a new empty TabSettings when none is selected; SelectedTabId, SelectedTabIndex and SelectedTabText are derived from it. (BR-V2-069, BR-V2-070)
  4. SAIFTabs.IsDesign returns True when reading Page.User throws, which is used to suppress run-time-only behaviour in the designer. (BR-V2-071)
  5. SAIFTabBar.CreateChildControls creates one LinkButton per tab and assigns CSS classes Selected, SelectedSibling, Disabled or DisabledSelected according to tab state and position; the bar itself is styled SAIFTabBar or SAIFWizardTabBar depending on Mode. (BR-V2-072, BR-V2-073, BR-V2-074)
  6. SAIFTabBar persists its tab collection through SaveViewState/LoadViewState, and exposes EnableAllTabs, DisableAllTabs, ShowAllTabs, HideAllTabs and Tabs.GetTabByID for bulk state changes. (BR-V2-075, BR-V2-076)
  7. SAIFTabBarTabCollection.Sort uses the reflection-based Sorter(Of T) comparer to order tabs by a named property. (BR-V2-077)

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([AddTab/InsertTab]) --> Create[Create TabSettings entry]
    Create --> Sel{Tab selected?}
    Sel -->|Yes| Event[Raise SelectedIndexChanged]
    Sel -->|No| Bar
    Event --> Bar[SAIFTabBar.CreateChildControls]
    Bar --> Style[Assign per-tab CSS classes]
    Style --> Persist[Persist via SaveViewState/LoadViewState]
    Persist --> Done([Tabs rendered])

Failure and edge-case behavior

  • No exceptional failure handling beyond the branches described in Steps was found in the analysis findings.*

Sources

  • SAIF.Presentation.Web.Controls.V2/SAIFTabs.vb