|
Mastering PowerBuilder DataWindow Synchronization in DPB
PowerBuilder has a different set of APIs (listed below) to synchronize DataWindows/DataStores. All of them use a BLOB object as argument.
- GetFullState()—Reads the full state of the DataWindow and populates the BLOB object. The full state includes the DataWindow object definition, data and the status of each row and column. The resuling BLOB object can be used to set the another DataWindow/DataStore.
- SetFullState()—Typically, the BLOB object returned by the GetFullState() is send as an argument to this function. This function sets the DataWindow with the DataWindow object, data and status as specified in the BLOB object. Since this function also sets the DataWindow object, the target DataWindow control/DataStore do not have a DataWindow object assigned before calling this function.
- GetChanges()—This function takes all the changes in the specified DataWindow and populates the BLOB object.
- SetChanges()—Typically, the BLOB object returned by the GetChanges() is send as an argument to this function. This function applies all the changes to the target DataWindow. If you call Update() on either the source DataWindow or target DataWindow, both will result in same. Similar to the SetFullState(), this function also sets the DataWindow object. You do not have to keep the retrieved data in the target DataWindow in order to apply changes with SetChanges() function.
- GetStateStatus()—Retrieves the internal state flags of the given DataWindow into a BLOB object. This function is used when you have one source DataWindow and multiple target DataWindows and want to keep all of them in sync. This function is obsolete with version 7.0.
The GetFullState() loads the following into the BLOB object.
- All Data from all buffers (Only changed info is taken by the GetChanges())
- Row/Column and any internal status flags
- Complete DataWindow syntax
- All DropDownDataWindow syntax and data
The following illustration illustrates all the steps involved in the DataWindow synchronization. We are not including any examples in this section, since we will be writing in the actual application later in this session.
|