To use the DataWindow object in an application, you add a DataWindow control to a window, then associate that control with the DataWindow object.
Figure 9-1: DataWindow control before association with an object
To place a DataWindow control in a window or custom visual user object:
Open the window or user object that will contain the DataWindow control.
Select Insert>Control>DataWindow from the menu bar.
Click where you want the control to display.
PocketBuilder places an empty DataWindow control in the window.
(Optional) Resize the DataWindow control by selecting it and dragging one of the handles, or changing its position properties on the Other page of the Properties view.
After placing the DataWindow control, you associate a DataWindow object with the control.
To associate a DataWindow object with the control:
In the DataWindow Properties view, click the Browse button for the DataObject property.
Select the DataWindow object that you want to place in the control and click OK.
The name of the DataWindow object displays in the DataObject box in the DataWindow Properties view.
(Optional) Change the properties of the DataWindow control as needed.
You might want all the DataWindow controls in your application to have similar appearance and behavior. For example, you might want all of them to do the same error handling.
To be able to define these behaviors once and reuse them in each window, you create a standard visual user object based on the DataWindow control. Define the user object's properties and write scripts that perform the generic processing you want, such as error handling. Then place the user object (instead of a new DataWindow control) in the window. The DataWindow user object has all the desired functionality predefined. You do not need to specify it again.
For more information about creating and using user objects, see the User's Guide.
Once you have associated a DataWindow object with a DataWindow control in a window, you can go directly to the DataWindow painter to edit the associated DataWindow object.
To edit an associated DataWindow object:
Select Modify DataWindow from the DataWindow control's pop-up menu.
PocketBuilder opens the associated DataWindow object in the DataWindow painter.