PEAR Progress2 logo

HTML_Progress2 : The Definitive Guide

Chapter 7. Listener

Table of Contents

Events categories
How to observe events ?

HTML_Progress2 class provides an implementation of the observer pattern. It provide a mechanism which you can examine each important event as it is happened. This allow the implementation of special behavior based on the value of the progress meter.

Implementation of a standardized observer pattern is made with help of PEAR::Event_Dispatcher package (manual ).

Events categories

Depending on action triggered, there are four events you may be listen:

  • onSubmit. This event corresponding to start of progress meter (at launch of run() method).

  • onLoad. This event corresponding when progress meter reach 100% (just after run() method execution).

  • onChange This event corresponding when progress meter value is changed. Many reasons :

    • declare or change minimum value with setMinimum() method
    • declare or change maximum value with setMaximum() method
    • change current value with setValue() or incValue() methods
    • refresh display with moveStep() or moveNext() methods
  • onCancel [progress monitor only]. This event corresponding when progress monitor is stopped by user action (cancel key pressed).

HTML_Progress2 : The Definitive Guide v 2.4.0 : April 20, 2007