Package com.cmobilecom.af.model.behavior
Class DomEventSupport
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<java.lang.String,java.lang.String>
-
- com.cmobilecom.af.model.behavior.DomEventSupport
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.String,java.lang.String>
public class DomEventSupport extends java.util.HashMap<java.lang.String,java.lang.String> implements java.io.Serializable
DomEventSupport is a map from event to handler, and can be used in JSF EL expression like map['name']. Event handler is client script only, not ajax.- Since:
- 4.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EVENT_CHANGE
Value change event, supported by input entity propertiesstatic java.lang.String
EVENT_CLICK
Click event, supported by Menu nodes.static java.lang.String
EVENT_FOCUS
Focus event, supported by input text entity propertiesstatic java.lang.String
EVENT_KEY_PRESS
Keypress event, supported by input text entity properties
-
Constructor Summary
Constructors Constructor Description DomEventSupport(ClientBehaviorHolder clientBehaviorHolder)
Constructor with clientBehaviorHolder such as a MenuNode or EntityProperty.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEventHandler(java.lang.String event, java.lang.String script)
Add client event behavior that is static script only, not ajax.java.lang.String
get(java.lang.Object event)
Get event handler.boolean
isDynamicHandler(java.lang.String event)
Is the event handler dynamic for the event?void
removeEventHandler(java.lang.String event)
Remove client event behavior.void
setDynamicHandler(java.lang.String event, boolean dynamic)
Set whether the handler for the event is dynamic.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Field Detail
-
EVENT_CLICK
public static final java.lang.String EVENT_CLICK
Click event, supported by Menu nodes.- See Also:
- Constant Field Values
-
EVENT_CHANGE
public static final java.lang.String EVENT_CHANGE
Value change event, supported by input entity properties- See Also:
- Constant Field Values
-
EVENT_FOCUS
public static final java.lang.String EVENT_FOCUS
Focus event, supported by input text entity properties- See Also:
- Constant Field Values
-
EVENT_KEY_PRESS
public static final java.lang.String EVENT_KEY_PRESS
Keypress event, supported by input text entity properties- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DomEventSupport
public DomEventSupport(ClientBehaviorHolder clientBehaviorHolder)
Constructor with clientBehaviorHolder such as a MenuNode or EntityProperty.- Parameters:
clientBehaviorHolder
- ClientBehaviorHolder instance
-
-
Method Detail
-
addEventHandler
public void addEventHandler(java.lang.String event, java.lang.String script)
Add client event behavior that is static script only, not ajax.- Parameters:
event
- supported DOM event such as focus, click, mouseover, etc.script
- event handler
-
removeEventHandler
public void removeEventHandler(java.lang.String event)
Remove client event behavior.- Parameters:
event
- supported DOM event such as focus, click, mouseover, etc.- Since:
- 5.5
-
setDynamicHandler
public void setDynamicHandler(java.lang.String event, boolean dynamic)
Set whether the handler for the event is dynamic. If dynamic, its ClientBehaviorHolder needs to provide event handler script.- Parameters:
event
- DOM event such as click, focus.dynamic
- true for dynamic
-
isDynamicHandler
public boolean isDynamicHandler(java.lang.String event)
Is the event handler dynamic for the event?- Parameters:
event
- DOM event name- Returns:
- true if dynamic
-
get
public java.lang.String get(java.lang.Object event)
Get event handler. If dynamic, get the handler script from its ClientBehaviorHolder.- Specified by:
get
in interfacejava.util.Map<java.lang.String,java.lang.String>
- Overrides:
get
in classjava.util.HashMap<java.lang.String,java.lang.String>
- Parameters:
event
- DOM event name- Returns:
- event handler that is script.
-
-