org.wings.script
Class JavaScriptDOMListener

java.lang.Object
  extended by org.wings.script.JavaScriptListener
      extended by org.wings.script.JavaScriptDOMListener
All Implemented Interfaces:
EventListener, ScriptListener
Direct Known Subclasses:
PopupListener

public class JavaScriptDOMListener
extends JavaScriptListener

Specialized ScriptListener for DOM events. The original JavaScriptListener uses inline events (e.g.

), this one the events of the DOM.

Author:
Christian Schyma

Field Summary
 
Fields inherited from class org.wings.script.JavaScriptListener
JS_FORM_SUBMIT_SCRIPT, JS_ON_CHANGE_SUBMIT_FORM
 
Fields inherited from interface org.wings.script.ScriptListener
DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY
 
Constructor Summary
JavaScriptDOMListener(String event, String code, SComponent component)
           
JavaScriptDOMListener(String event, String code, String customObject, SComponent component)
           
 
Method Summary
 String getScript()
          Returns executable code to initialize the JavaScript listener for the given component.
 
Methods inherited from class org.wings.script.JavaScriptListener
equals, getCode, getComponents, getEvent, getPriority, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaScriptDOMListener

public JavaScriptDOMListener(String event,
                             String code,
                             SComponent component)
Parameters:
event - one of JavaScriptDOMEvent (e.g. JavaScriptDOMEvent.ON_CLICK) to act on
code - callback function fired on event
component - the component this listener is associated with

JavaScriptDOMListener

public JavaScriptDOMListener(String event,
                             String code,
                             String customObject,
                             SComponent component)
Parameters:
event - one of JavaScriptDOMEvent (e.g. JavaScriptDOMEvent.ON_CLICK) to act on
code - callback function fired on event
customObject - object that is used for the execution scope (so it becomes "this" in the callback) instead of the default execution scope of the element the event was fired upon
component - the component this listener is associated with
Method Detail

getScript

public String getScript()
Returns executable code to initialize the JavaScript listener for the given component.

Specified by:
getScript in interface ScriptListener
Overrides:
getScript in class JavaScriptListener
Returns:
init code


wingS Swings ;-)