displayRow

displayRow(control:   control-name input;      (Table)
           theSheet:  Integer;
           obj:       Object;
           theRow:    Integer;
           bcontinue: Boolean io): String;

displayRow(control:   control-name input;      (ComboBox or ListBox)
           obj:       Object;
           theRow:    Integer;
           bcontinue: Boolean io): String;

The displayRow event method occurs for each entry in the collection attached to the current sheet or list of a ComboBox, ListBox, or Table control by using the displayCollection method, to display the contents of the row. The displayRow event method parameters are listed in the following table.

Parameter Description
control The combo box, list box, or table that is calling the event method.
theSheet The index of the sheet in the table.
obj The object to be displayed, which must be cast to the appropriate type for actual access.
theRow The row into which the entry is being placed (a blank row already exists).
bcontinue Returns false if all entries in the collection beyond this point are to be ignored or returns true if processing is to continue. This io parameter is initialized to true. When a collection is attached to ListBox and Table controls using the displayCollection method and the collection is an Array, Dictionary, or Set and the bcontinue parameter returns false, the list size is adjusted and remembered but users can drag the list past that entry without the displayRow event being called for that entry, and JADE is therefore unaware that the display size was to be limited. You therefore cannot rely on the bcontinue parameter to limit the display up to the required point.

This event method returns a string that is used to set the contents of the row, starting with the first column regardless of whether it is a fixed column of a Table control or not. Tab characters must be placed between the text values of each cell in a table.

The value of the itemObject property for the row is set to the object value contained in the obj parameter.

If a null string ("") is returned, no row is added to the table or list.

The method in the following example shows the use of the displayRow event method.

tbProducts_displayRow(table:     Table input;
                      theSheet:  Integer;
                      obj:       Object;
                      theRow:    Integer;
                      bcontinue: Boolean io): String;
vars
    prod : Product;
begin
    prod := obj.Product;
    if prod.superseded then
        return null;
    endif;
    if prod.date < 010198.Date then
        bcontinue := false;        // have all the entries required
        return null;
    endif;
    return prod.code.String & Tab & prod.name;  // Return text for each cell
                                                // separated by a tab
end;

As this event method can set the bcontinue parameter to false if processing of further collection entries is not required and therefore provides the ability to terminate the load process, this event method enables you to perform a load of all products whose names start with the letter s, for example.

The scroll bar may not necessarily show the correct extent of scrolling available, as the number of entries to be displayed may not be known accurately.

If the update parameter of the displayCollection method is set to true:

If the update parameter is set to false, the table is not updated when the collection changes and may contain out-dated information.

The value of the update parameter must be false for transient collections, as JADE does not issue system notifications for the addition, change, or deletion of a transient collection.

When using the displayRow event method, you should also be aware of the following.