Focus-control script generation¶
This operation generates and registers client-side JavaScript that focuses (and, for text-input types, selects) a target control on the page, driven by the FocusControl property set by the page/consuming code.
| Field | Value |
|---|---|
| Operation ID | OP-AVMPB-001 |
| Trigger | Page_PreRender on any master page inheriting AppViewMasterPageBase |
| Inputs | FocusControl property (set by the page/consuming code) |
| Outputs | A registered startup script that focuses (and optionally selects) the target control |
| Primary components | AppViewMasterPageBase.RenderClientScripts, RegisterFocusControlScript, nested NavigationManager class |
| Entry point | SAIF.Presentation.Web.Core.Infragistics103\AppViewMasterPageBase.vb |
Steps¶
Page_PreRendercallsRenderClientScripts.RenderClientScripts: ifFocusControlis notNothing, callsRegisterFocusControlScript.RegisterFocusControlScriptbranches on the runtime type name ofFocusControlto build a jQuery/JS snippet that focuses (and for text-input types, selects) the client-rendered element, wrapped in a 100mssetTimeoutand atry/catch:Infragistics.WebUI.WebDataInput→ focus and select via jQuery#igtxt<ClientID>.Infragistics.WebUI.WebCombo→ focus and select via jQuery on the combo's input element.Infragistics.WebUI.WebSchedule.WebDateChooser→ focus and select via jQuery on the date chooser's input element.System.Web.UI.WebControls.Button→ focus only, via jQuery.Infragistics.Web.UI.ListControls→ no script generated (empty branch)*.- Any other type → focus and select via jQuery on the control's
ClientID. - The script is registered via
UI.ScriptManager.RegisterStartupScript. - The nested
NavigationManagerclass provides an alternate, session-persisted (Session("focuscontrol")) mechanism*: BoundControlIdsetter classifies a control into one of several Infragistics control-type buckets (or falls back toClientID).GenerateScripts()emits the type-appropriate Infragistics API call (igdrp_getComboById,igcmbo_getComboById,igedit_getById, or a plain jQuery focus/select) — this appears to be an older/parallel focus mechanism toRegisterFocusControlScript*.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Page_PreRender]) --> S1[RenderClientScripts]
S1 --> D1{FocusControl set?}
D1 -->|No| EndNone([No script registered])
D1 -->|Yes| S2[RegisterFocusControlScript]
S2 --> S3{Control runtime type?}
S3 -->|WebDataInput| S4a[Focus and select via jQuery]
S3 -->|WebCombo| S4b[Focus and select combo input]
S3 -->|WebDateChooser| S4c[Focus and select date input]
S3 -->|Button| S4d[Focus only]
S3 -->|ListControls| S4e[No script - empty branch]
S3 -->|Other| S4f[Focus and select via jQuery ClientID]
S4a --> S5[RegisterStartupScript]
S4b --> S5
S4c --> S5
S4d --> S5
S4e --> S5
S4f --> S5
S5 --> EndOk([Script registered])
Failure and edge-case behavior¶
- The generated script is wrapped in a
try/catchon the client side, so a JavaScript error focusing the control is silently swallowed in the browser. - The
Infragistics.Web.UI.ListControlsbranch generates no focus script, leaving the base string with no client action appended*.
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.Core.Infragistics103\AppViewMasterPageBase.vb