clsObjectBinderBase¶
This abstract binder contract concentrates the reflection, validation, padding, and control-formatting behavior shared by every concrete binder in the library. clsObjectBindManager creates subclasses for specific control families, and those subclasses supply only the control-specific transfer logic required by the manager's binding pipeline.
Purpose¶
- Define the common binder lifecycle every concrete binder must implement.
- Centralize shared property access, error harvesting, padding, and control formatting across all binder families.
- Enforce the common UI-validation behaviors captured by BR-BIND-001, BR-BIND-002, BR-BIND-003, and BR-BIND-006.
Context¶
- Namespace:
SAIF.Presentation.Web.Binding - Assembly/package:
SAIF.Presentation.Web.Binding.Infragistics103(embedded/bundled as source, not independently packaged)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| Init | Public MustOverride Sub Init() |
Lets each concrete binder wire events and perform startup work before participating in manager workflows. |
| ObjectToControl | Public MustOverride Function ObjectToControl() As Boolean |
Pushes the current source value into the attached control. |
| ControlToObject | Protected Friend MustOverride Sub ControlToObject() |
Pulls the current control value back into the bound object. |
| ContainsError | Protected Friend ReadOnly Property ContainsError() As Boolean |
Reports whether the most recent validation pass found an error for this binder. |
| IsDualBinding | Protected Friend ReadOnly Property IsDualBinding() As Boolean |
Reports whether display binding and validation binding come from different object/property pairs. |
| ControlPadding | Public Property ControlPadding() As PadArgs |
Defines padding applied when values are prepared for control-side display. |
| ObjectPadding | Public Property ObjectPadding() As PadArgs |
Defines padding applied when values are written back into object properties. |
| UsePadding | Public Property UsePadding() As Boolean |
Enables or disables the padding pipeline used by the value helpers. |
| UseEvents | Public Property UseEvents() As Boolean |
Controls whether native control events trigger immediate object updates. |
| ControlErrors | Public ReadOnly Property ControlErrors() As ArrayList |
Returns the validation messages currently associated with this binder. |
| BindType | Public Property BindType() As BindTypes |
Chooses whether the binder participates in outbound, inbound, two-way, or validation-only workflows. |
| FormControl | Public Overridable Property FormControl() As WebControls.WebControl |
Attaches the control instance and triggers control-type processing for the binder. |
| FormControlID | Public Overridable ReadOnly Property FormControlID() As String |
Returns the attached control's UniqueID for manager lookup and update matching. |
| SetControlFormat | Protected Friend Overridable Sub SetControlFormat(ByVal inValid As Boolean) |
Applies valid/error CSS classes while respecting BR-BIND-001, BR-BIND-002, and BR-BIND-003. |
| GetErrors | Protected Friend Overridable Sub GetErrors() |
Reads IDataErrorInfo.Item(property) from the effective validation target and splits the returned text into individual messages. |
| GetObjectValueAsString | Public Function GetObjectValueAsString(ByVal inBizObject As Object, ByVal inPropertyName As String) As String |
Reads an object's property through TypeDescriptor, converts it to text, and optionally applies control-side padding. |
| GetObjectValue | Public Function GetObjectValue(ByVal inBizObject As Object, ByVal inPropertyName As String) As Object |
Reads an object's property through TypeDescriptor without forcing string conversion. |
| SetObjectValueAsString | Protected Function SetObjectValueAsString(ByVal inBizObject As Object, ByVal inPropertyName As String, ByVal inValue As String) As Boolean |
Writes a string value to an object's property and reports whether a target object was available. |
| SetObjectValue | Protected Function SetObjectValue(ByVal inBizObject As Object, ByVal inPropertyName As String, ByVal inValue As Object) As Boolean |
Writes an object value to an object's property and reports whether a target object was available. |
| ValidationKey | Friend Overridable ReadOnly Property ValidationKey() As String |
Produces the manager dictionary key used to track validation objects per BR-BIND-006. |
| IsSAIFFrameWorkObject | Friend Overridable ReadOnly Property IsSAIFFrameWorkObject(Optional ByVal inObj As Object = Nothing) As Boolean |
Used by Validate()/GetErrors() to decide whether the bound object exposes IsValid/IDataErrorInfo semantics consistent with the SAIF business-object framework, gating which error-harvesting path is taken. |
Behavioral notes¶
ValidationKeyreturnsMyGuidfor recognized SAIF framework objects and the uppercased CLR type name for all others, implementing BR-BIND-006.SetControlFormat(True)never overwritesCssClass = "disabledbackcolor", implementing BR-BIND-001.SetControlFormatexcludesUltraWebGrid,WebDataGrid, andCheckBoxListfrom generic valid/error CSS assignment as required by BR-BIND-002.SetControlFormat(False)assignserrorbordercolorto multi-lineTextBoxcontrols anderrorbackcolorto other eligible controls, implementing BR-BIND-003.
Constraints and usage notes¶
- Concrete binders must implement all three abstract transfer methods to participate in manager workflows.
GetErrors()assumes the effective validation object implementsIDataErrorInfo.FormControlprocessing occurs as soon as the property is set, so binders should attach the control before running their own initialization.
Sources¶
SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBinderbase.vb