net.sf.click
Class ControlRegistry
java.lang.Object
net.sf.click.ControlRegistry
- public class ControlRegistry
- extends Object
Provides a thread local register for ActionListener events. The ClickServlet
will fire any ActionListeners registered after processing all the page's
controls.
Example Usage
Developers who implement their own controls, should look at the following
example control onProcess implementation.
public class MyLink extends AbstractControl {
...
public boolean onProcess() {
bindRequestValue();
if (isClicked()) {
// Register this controls listener for invocation after
// control processing has finished
registerActionEvent();
}
return true;
}
}
In this example if the link is clicked, it then calls
AbstractControl.registerActionEvent()
.
This method registers the Control's action listener with ControlRegistry.
The ClickServlet will subsequently invoke the registered
ActionListener.onAction(Control)
methods after all the Page's control
onProcess() methods have been invoked.
- Author:
- Bob Schellink, Malcolm Edgar
Method Summary |
static void |
registerActionEvent(Control source,
ActionListener listener)
Register the event source and event ActionListener to be fired by the
ClickServlet once all the controls have been processed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ControlRegistry
public ControlRegistry()
registerActionEvent
public static void registerActionEvent(Control source,
ActionListener listener)
- Register the event source and event ActionListener to be fired by the
ClickServlet once all the controls have been processed.
- Parameters:
source
- the action event sourcelistener
- the event action listener