Chapter 3. Controls

3.1. Control Interface
3.2. Control Listener
3.3. Control Classes
3.4. Message Properties
3.4.1. Message Resolution
3.4.2. Control Properties
3.4.3. Accessing Messages
3.5. Control HEAD Elements
3.6. Container
3.6.1. AbstractContainer
3.6.2. AbstractContainerField
3.7. Layouts
3.7.1. Template layout
3.7.2. Programmatic layout
3.8. Behavior
3.8.1. Behavior Execution
3.8.2. Behavior Example

Apache Click provides a rich set of Controls which support client side rendering and server side processing. Please see the Javadoc, which provides extensive information and examples of the core Controls.

This chapter covers Control in detail including the Control life cycle, Control listeners and localization.

3.1. Control Interface

Controls provide the server side components that process user input, and render their display to the user. Controls are equivalent to Visual Basic Controls or Delphi Components.

Controls handle the processing of user input in the onProcess method and render their HTML display using the toString() method. The execution sequence for a Control being processed and rendered is illustrated in the figure below.

Post Sequence Diagram

Figure 3.1. Post Sequence Diagram

In Click all control classes must implement the Control interface. The Control interface is depicted in the figure below.

Control Interface Diagram

Figure 3.2. Control Interface Diagram

Methods on the Control interface include: