trigger getFocus (Frame)

Trigger that responds to the frame getting focus (usually when the frame is about to be printed).

Declaration: trigger getFocus
Applies to: Frames in form and report components
Activation: Activated when a header, trailer, or break frame is about to be printed (in reports) or displayed (in forms).
Default behavior: None
Behavior upon completion: None

Description

This trigger is used to perform actions before the frame is displayed. You can use the getFocus trigger for:

  • Accumulating values in subtotal and total fields further down in the print process.
  • Calculating and copying values into fields in break frames.

For example, in a trailer frame, you might increment the page number variable, or in a break frame, you might increment running totals. In trailer frames, it can be used to print the page number.

Filling fields in a header frame on the basis of the calculated values on the rest of the page might not always be possible, because the data concerned has not become active. If it is important to do this, use the selectdb ProcScript statement.

The getFocus trigger of a header frame should not be used to assign data to fields on the form. This is because Uniface activates the getFocus trigger after the first occurrence has been fetched and is ready to print.

Note:  The OGF abbreviation appears in the Debugger because it considers this to be an occurrence of the header, trailer, or break frame.

; frame : TRAILER
trigger getFocus
  PAGE.TRAILER = $page
end; getFocus

Related Topics