Collapsible panel state toggle¶
This operation manages the expand/collapse state of a SAIFPanel, persisting it through a hidden field so it survives postbacks, and applying the corresponding inline display style and image on each render pass.
| Field | Value |
|---|---|
| Operation ID | OP-V2-PANEL-001 |
| Trigger | Postback containing the hidden StateControl field value ("Collapsed"/other). |
| Inputs | HttpContext.Current.Request(Me.UniqueID & "$StateControl"). |
| Outputs | Header/Title/collapse-expand image/hidden state field/Content panel control tree with correct display style and image URL. |
| Primary components | SAIFPanel.SAIFPanel_Init, SAIFPanel.CreateChildControls, SAIFPanel.SAIFPanel_PreRender. |
| Entry point | SAIF.Presentation.Web.Controls.V2\SAIFPanel.vb |
Steps¶
SAIFPanel_InitreadsHttpContext.Current.Request(Me.UniqueID & "$StateControl"); if present and non-empty, sets_PanelStateaccordingly.CreateChildControlsbuilds the Header/Title/collapse-expand image/hidden state field/Content panel tree, using_PanelStateto decide the initialdisplay: none;/display: block;inline style and expand/collapse image URL.-
PreRenderre-syncs the collapse/expand image and hidden field to the current_PanelState. -
No server-side business logic determines panel state beyond what the client posts back — actual expand/collapse toggling is client-script driven (the referenced
Panel.jsscript file is not included in this project)*.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Postback]) --> Init[SAIFPanel_Init reads StateControl field]
Init --> Decision{State value present?}
Decision -->|Yes| Set[Set _PanelState from posted value]
Decision -->|No| Keep[Keep existing _PanelState]
Set --> Create[CreateChildControls builds tree with matching display style]
Keep --> Create
Create --> PreRender[PreRender re-syncs image and hidden field]
PreRender --> Done([Rendered panel HTML])
Failure and edge-case behavior¶
- An unrecognized or missing
StateControlvalue leaves_PanelStateat its prior/default value (Expanded) rather than raising an error. - The client-side
Panel.jsscript that performs the actual collapse/expand animation is not present in this project folder; its exact behavior could not be verified from this library's source**.
Related documentation¶
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\SAIFPanel.vb