Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 2 (10.2) Part Number B14308-01 |
|
You use OBound objects in conjunction with an instance of the OBinder class. (See the description of the OBinder class for details on how these two classes are used, including discussion of the trigger methods.)
OBound is an abstract class; you never declare any instances of it. This release contains a set of OBound subclasses that implements data-aware user interface widgets. You can subclass those subclasses, or you can subclass OBound directly to implement other bound objects. The Workbook contains examples of creating OBound subclasses, and how to use the provided subclasses.
OBound subclasses must implement two methods: Refresh and SaveChange. The Refresh method transfers a value from the dynaset to the OBound instance. It is called, for example, whenever the dynaset navigates to a new record. The SaveChange method is called when it is time to set the value in the Oracle database, for example, after a change has been made and the dynaset is trying to move to a different record. It is usually implemented using the SetValue method of OBound.
OBound subclasses may also override the default triggers. If you do this, you should know that the overloaded trigger you write should call the default trigger in the OBound class. This will cause the bound object to be refreshed (have its value updated) when the database record is altered. Alternatively, the overloaded PostAdd, PostMove, PostRollback and PostQuery triggers can call RefreshBound() directly. In either case, the Refresh method you wrote is called to refresh the bound control.
OBound instances generally allow some form of editing of the data that they contain. When a change is made, the OBound instance must call the Changed method to inform the OBinder/OBound bookkeeping machinery that the object has been changed.
The OBound class supports the following methods:
Construction and destruction:
Attributes:
operator== operator!= Changed |
IsChanged IsOpen |
BindToBinder Close GetDatabase GetDynaset GetName |
GetValue Refresh SaveChange SetValue Unbind |
PostAdd PostDelete PostMove PostQuery PostRollback PostUpdate PreAdd |
PreDelete PreMove PreQuery PreRollback PreUpdate Shutdown Startup |