Skip to content

AutoBindControlAncestor

AutoBindControlAncestor is the shared implementation of iAutoBindingControl used by every concrete auto-binding editor (AutoBindTextbox, AutoBindWebMaskEdit, AutoBindWebDateTimeEdit). It resolves a dotted model path to a bound object by reflection, copies values in both directions, drives validation off the bound object's IDataErrorInfo, writes assembled messages to the page's LblErrorMsg label, and wraps each editor in an Infragistics WARP inside a hover-trigger panel so validation updates render asynchronously.

Purpose

  • Resolves BoundObject by walking the dotted BindSource path from RootBindingObject and copies its BindProperty value into the control's Value on bind, and back on user edit. (BR-AJAX-004)
  • Drives automatic validation after data binding and after user edits unless the corresponding switch is turned off, keeping the model and UI in sync without page code. (BR-AJAX-006)
  • Surfaces the bound object's IDataErrorInfo messages for the bound property, deduplicated and written to the page-level LblErrorMsg label. (BR-AJAX-008, BR-AJAX-010, BR-AJAX-011)
  • Wraps the concrete editor in a WARP and hover-trigger panel, registering the page's error label as a WARP refresh target so validation feedback updates asynchronously without a full postback.

Context

  • Namespace: SAIF.Presentation.Web.Controls.V2.AJAX
  • Assembly/package: SAIF.Presentation.Web.Controls.AJAX.Infragistics111 (packaged in SAIF.BOF.Presentation.Web.Infragistics111)
  • Implements: iAutoBindingControl
  • Base class: SAIFAJAXControlAncestor

Public members

Member Signature Purpose
AutoPostback Property AutoPostback As Boolean Controls whether the inner editor posts back on change
AutoBind Property AutoBind As Boolean Enables or disables participation in BindingManager.DataBind
AutoValidate Property AutoValidate As Boolean (default True) Enables automatic validation after a user edit (BR-AJAX-006)
AutoValidateOnDataBind Property AutoValidateOnDataBind As Boolean (default True) Enables automatic validation after data binding (BR-AJAX-006)
RootBindingObject Property RootBindingObject As Object The page model instance assigned by BindingManager
BoundObject ReadOnly Property BoundObject As Object Object resolved by walking BindSource from RootBindingObject (BR-AJAX-004)
BindSource Property BindSource As String Dotted model path to BoundObject
BindProperty Property BindProperty As String Name of the property on BoundObject this control reads/writes
IsBound ReadOnly Property IsBound As Boolean Whether BoundObject currently resolves
IsValid ReadOnly Property IsValid As Boolean Current validity from IDataErrorInfo for the bound property
ErrorMessages ReadOnly Property ErrorMessages As String Deduplicated, <br>-joined validation messages (BR-AJAX-010)
Value Property Value As Object The editor's current value
DataBind Overrides Sub DataBind() Calls MyBase.DataBind(), then BindToControl if RootBindingObject is set, then validates if enabled (BR-AJAX-003)
BindToControl Sub BindToControl() Resolves BoundObject and copies its property into Value
BindToObject Sub BindToObject() Copies Value into BoundObject.<BindProperty> by reflection (BR-AJAX-007)
StyleControl Sub StyleControl(inValid As Boolean) Paints the editor red when invalid, resets it otherwise (BR-AJAX-012)
Validate Function Validate() As Boolean Assembles error messages, writes LblErrorMsg, styles the control, and always returns True* (BR-AJAX-011)
GetErrorMessages Function GetErrorMessages() As String() Casts BoundObject to IDataErrorInfo, reads Item(BindProperty), splits on CRLF; returns empty for an unbound control (BR-AJAX-008, BR-AJAX-009)
PageErrorLabel ReadOnly Property PageErrorLabel As Label Locates the page's LblErrorMsg label by recursive, case-insensitive UniqueID search (BR-AJAX-011)

Inherited public members

Members in this section are inherited from SAIFAJAXControlAncestor in SAIF.Presentation.Web.Controls.AJAX.Infragistics111. They are available on this type through inheritance.

Member Signature Purpose Origin
RootObject ReadOnly Property RootObject As Object The hosting page's Model property value SAIF.Presentation.Web.Controls.AJAX.Infragistics111 — SAIFAJAXControlAncestor
IsFirefox ReadOnly Property IsFirefox As Boolean Browser-capability test for the current request SAIF.Presentation.Web.Controls.AJAX.Infragistics111 — SAIFAJAXControlAncestor

Behavioral notes

  • Reflection failures anywhere in the bind/write-back path are caught and ignored, so a mistyped BindSource/BindProperty fails silently and the control simply keeps its previous Value. (BR-AJAX-005)
  • Validate() always returns True regardless of the computed validity, so callers must read IsValid separately; no caller in this library's own code uses the return value.*
  • This class is MustInherit and is never instantiated directly; concrete editors supply the actual ASP.NET input control it wraps.

Constraints and usage notes

  • The hosting page must expose a control literally named LblErrorMsg for validation messages to be displayed anywhere. (BR-AJAX-011)
  • AutoValidate and AutoValidateOnDataBind both default to True; validation cannot be silently skipped unless a page explicitly turns them off.

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.AJAX.Infragistics111/AutoBindControlAncestor.vb
  • SAIF.Presentation.Web.Controls.AJAX.Infragistics111/iAutoBindingControl.vb