---
title: SAIFWarp async-refresh initialization
summary: Registers the focus-restoration script and wires the panel's initialization client-side event during control Init.
status: draft
owner: SAIF Documentation Team
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.Controls.Infragistics103
reference_type: package
operation_id: OP-SAIFWARP-INIT
trigger: ASP.NET Init event of the SAIFWarp control
---

# SAIFWarp async-refresh initialization

This operation runs during the `Init` phase of the ASP.NET page lifecycle for a `SAIFWarp` control. Both the focus-restoration script registration and the panel's initialization event wiring occur only when `Not DesignMode` and `ControlsFocus` is `True`; when `ControlsFocus` is `False`, neither occurs during `Init`.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SAIFWARP-INIT |
| **Trigger** | ASP.NET `Init` event of `SAIFWarp` |
| **Inputs** | `ControlsFocus` property, `Page` context |
| **Outputs** | Registered client script blocks, `ClientSideEvents` wiring |
| **Primary components** | `SAIFWarp.SAIFWarp_Init` |
| **Entry point** | SAIF.Presentation.Web.Controls.Infragistics103\SAIFWarp.vb |

## Steps

1. If `DesignMode` is true, no script registration occurs at all (design-time no-op branch); processing stops here.
2. If `Not DesignMode` and `ControlsFocus` is `True`:
   a. Check whether the `FOCUS_SCRIPT_NAME` client script block is already registered.
      - If not registered: register the `FOCUS_SCRIPT` block, which defines `SAIFWARP_RefreshComplete` — a function that looks up a hidden field `{PanelID}_FOCUS` and calls `.focus()` on the referenced control three times — and set `ClientSideEvents.RefreshComplete = "SAIFWARP_RefreshComplete"`.
   b. Set `ClientSideEvents.InitializePanel = INIT_SCRIPT_NAME`.
3. If `Not DesignMode` and `ControlsFocus` is `False`: neither the focus-restoration script registration nor the `ClientSideEvents.InitializePanel` wiring occurs — `Init` performs no action for this control.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Init event fires]) --> Design{DesignMode?}
	Design -->|Yes| EndNoOp([No script registered, no InitializePanel wiring])
	Design -->|No| Focus{ControlsFocus = True?}
	Focus -->|No| EndNoOp2([No script registered, no InitializePanel wiring])
	Focus -->|Yes| Check{FOCUS_SCRIPT_NAME already registered?}
	Check -->|No| Register[Register FOCUS_SCRIPT block<br>Wire RefreshComplete event]
	Check -->|Yes| SetInit
	Register --> SetInit[Set ClientSideEvents.InitializePanel]
	SetInit --> EndOk([Init complete])
```

## Failure and edge-case behavior
- At design time (`DesignMode = True`), no script registration occurs — this is a normal no-op branch, not an error.
- When `ControlsFocus` is `False`, neither the focus-restoration script nor `ClientSideEvents.InitializePanel` is wired during `Init` — this is a normal branch, not an error, but it means `InitializePanel` (and therefore the progress-indicator init script wiring) is skipped entirely for this instance.
- If the focus script is already registered (e.g., multiple `SAIFWarp` instances on one page), registration is skipped to avoid duplicate script blocks, but `InitializePanel` wiring still occurs for each instance whose `ControlsFocus` is `True`.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- SAIF.Presentation.Web.Controls.Infragistics103\SAIFWarp.vb
