org.apache.click
Interface ActionListener

All Superinterfaces:
Serializable
All Known Implementing Classes:
ActionListenerAdaptor

public interface ActionListener
extends Serializable

Provides a listener interface for receiving control action events. The usage model is similar to the java.awt.event.ActionListener interface.

The class that is interested in processing an action event implements this interface, and the object created with that class is registered with a control, using the control's setActionListener method. When the action event occurs, that object's onAction method is invoked.

Listener Example

An ActionListener example is provided below:
 public MyPage extends Page {

    public ActionLink link = new ActionLink();

    public MyPage() {

       link.setActionListener(new ActionListener() {
           public boolean onAction(Control source) {
               return onLinkClick();
           }
        });
    }

    public boolean onLinkClick() {
       ..
       return true;
    }
 }
 


Method Summary
 boolean onAction(Control source)
          Return true if the control and page processing should continue, or false otherwise.
 

Method Detail

onAction

boolean onAction(Control source)
Return true if the control and page processing should continue, or false otherwise.

Parameters:
source - the source of the action event
Returns:
true if control and page processing should continue or false otherwise.