Example: Secondary Window

Previous Next

In this example, we will suppose you want to present the data from the PERSON table in the Persons info window in a spreadsheet.

To do this you need an option that allows the user to see all columns of the current person at a glance in a secondary info window.

To give the Persons info window a spreadsheet look:

1.Open the Persons info window.
2.Set the Column Manager property on the Layout tab page of this info window to Spreadsheet.
3.Set the No of Records Displayed layout property to 5.
4.Save.

NOTE: Because of the gridbox display, you can no longer view all the columns of the current record at a glance. For this reason you are going to build a secondary info window which will have single-record display and has automatic synchronization with the main info window (its master).

To create a secondary window with single-record display:

1.Right-click on the Persons secondary window class in the catalog and choose New from the menu.
A new subclass named Secondary of Persons - New is created.
2.Rename this new subclass to Persons single-record.
3.Open the Persons single-record secondary window class and using the property inspector, edit the class so that it diplays only the data that you require.
4.Save

To associate this secondary window with the Persons info window:

1.Open the Persons info window class.
2.Open the Controls tab page of the catalog.
3.Drag and drop a button from the catalog onto the design view.
4.Select the button and set its Label property on the Visual tab page to:

Table ...

5.Set its Action property on the Behavior tab page to:

WindowCreate('Persons single-record')

6.Save.

To explore the default functionality of a secondary window:

1.Open the Persons info window.
2.Query All Records.
3.Click the Table button.

The secondary window appears, displaying all columns of the current record.

1.Scroll in both windows and notice that they are synchronized both ways.

2.Update a value in one window and notice that the corresponding field in the other window is grayed out.