Control to object data pull¶
This operation iterates registered binders and pulls each control's current displayed value back into the bound business-object property, applying binder-specific type coercion.
| Field | Value |
|---|---|
| Operation ID | OP-BIND-003 |
| Trigger | Explicit call to BindToObject(inAllControls), or invoked as the first step of Validate()/RefreshValidation() |
| Inputs | inAllControls flag (default False); each binder's current control value |
| Outputs | Business-object property values updated from control state |
| Primary components | clsObjectBindManager.BindToObject, clsObjectBinderBase.ControlToObject (per concrete binder), clsObjectBinderBase.SetObjectValue/SetObjectValueAsString |
| Entry point | SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vb |
Steps¶
- Iterate
m_Bindings; select binders whereinAllControlsis true OR the binder'sUseEventsis false. - For each selected binder with
BindType=ControlToObjectorTwoWay, callBinder.ControlToObject(). - Each concrete
ControlToObject()reads the control's native value, performs type coercion appropriate to the target property (e.g.,clsTextBoxBinderusesConvert.ChangeTypeguarded by a swallowedExceptioncatch;clsDDLBinder.ControlToObjectswitches onObjectDataType— Date/Decimal/Integer/String/Boolean/Enum — calling[Enum].Parsefor enum targets), then callsSetObjectValue/SetObjectValueAsString(reflectionPropertyInfo.SetValue, with optional object-side padding). - On failure:
clsTextBoxBinder.ControlToObjectsilently swallows conversion exceptions (Catch ex As Exceptionwith an empty body) — a failed conversion leaves the object property unchanged and is not surfaced to the caller.*
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([BindToObject called]) --> Iterate[Iterate m_Bindings]
Iterate --> Select{inAllControls or UseEvents false?}
Select -->|No| Skip[Skip binder]
Select -->|Yes| BindTypeCheck{BindType is ControlToObject or TwoWay?}
BindTypeCheck -->|No| Skip
BindTypeCheck -->|Yes| ReadControl[Read native control value]
ReadControl --> Coerce[Type coercion per binder]
Coerce -->|Success| SetProp[SetObjectValue via reflection]
Coerce -->|Exception| Swallow[Swallow exception, leave property unchanged]
SetProp --> Skip
Swallow --> Skip
Skip --> More{More binders?}
More -->|Yes| Iterate
More -->|No| EndOk([Object properties updated])
Failure and edge-case behavior¶
- Conversion exceptions during
ControlToObject()are caught and swallowed in at leastclsTextBoxBinder, leaving the property at its prior value without notifying the caller.*
Related documentation¶
Sources¶
SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vbSAIF.Presentation.Web.Binding.Infragistics103\ASPControls\clsTextBoxBinder.vbSAIF.Presentation.Web.Binding.Infragistics103\ASPControls\clsDDLBinder.vb