Registers a "user"
EventListener
.
When this listener is registered the server sends custom JavaScript code to register a handler in the client side with the specified node target and name.
User events are fired in the client calling the ItsNat JavaScript method fireUserEvent(targetNode,name)
or dispatchUserEvent(targetNode,evt)
(where evt
is a special user event see Manual for more info). For instance:
document.getItsNatDoc().fireUserEvent(document.body,"myUserAction");
Target node and name must be the same parameters used to register the listener.
If two or more listeners are registered sharing the same node target and name, they all will receive the same event fired by fireUserEvent
with this target/name pair. If a listener instance was already registered and is registered again with the same target and name, this second call does nothing.
@param target target element. Can not be null.
@param name the user defined event type name.
@param listener the listener to receive events.
@param commMode communication mode.
@param extraParams optional client to server data transport and synchronization rules. May be null.
@param preSendCode custom JavaScript code to execute before an event of this listener type is fired. May be null.
@param eventTimeout the timeout of asynchronous events. If negative no timeout is defined.
@see #removeUserEventListener(org.w3c.dom.events.EventTarget,String,EventListener)
@see #addEventListener(org.w3c.dom.events.EventTarget,String,org.w3c.dom.events.EventListener,boolean,int,org.itsnat.core.event.ParamTransport[],String,long)
@see ClientDocument#addUserEventListener(org.w3c.dom.events.EventTarget,java.lang.String,org.w3c.dom.events.EventListener,int,org.itsnat.core.event.ParamTransport[],java.lang.String,long)
@see CommMode