Skip to content

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

  1. Iterate m_Bindings; select binders where inAllControls is true OR the binder's UseEvents is false.
  2. For each selected binder with BindType = ControlToObject or TwoWay, call Binder.ControlToObject().
  3. Each concrete ControlToObject() reads the control's native value, performs type coercion appropriate to the target property (e.g., clsTextBoxBinder uses Convert.ChangeType guarded by a swallowed Exception catch; clsDDLBinder.ControlToObject switches on ObjectDataType — Date/Decimal/Integer/String/Boolean/Enum — calling [Enum].Parse for enum targets), then calls SetObjectValue/SetObjectValueAsString (reflection PropertyInfo.SetValue, with optional object-side padding).
  4. On failure: clsTextBoxBinder.ControlToObject silently swallows conversion exceptions (Catch ex As Exception with 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 least clsTextBoxBinder, leaving the property at its prior value without notifying the caller.*

Sources

  • SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\ASPControls\clsTextBoxBinder.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\ASPControls\clsDDLBinder.vb