com.ibm.xsp.component
Class UIEventHandler

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UICommand
              extended by com.ibm.xsp.component.UICommandEx2
                  extended by com.ibm.xsp.component.UIEventHandler
All Implemented Interfaces:
com.ibm.xsp.component.FacesNavigationBehaviour, FacesParentReliantComponent, FacesSaveBehaviour, javax.faces.component.ActionSource, javax.faces.component.NamingContainer, javax.faces.component.StateHolder
Direct Known Subclasses:
XspEventHandler

public class UIEventHandler
extends UICommandEx2
implements javax.faces.component.NamingContainer, FacesParentReliantComponent

An Abstract Component that is used to apply event handling to its parent component. Event Handling is in two parts, by means of Server side actions and client side script, which can be assigned to any valid event of the parent Component.

By default, the rendererType property must be set to "com.ibm.faces.CommandBehaviour" This value can be changed by calling the setRendererType() method.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponentBase
javax.faces.component.UIComponentBase.AggregatedIterator, javax.faces.component.UIComponentBase.UnmodifiableIterator
 
Nested classes/interfaces inherited from class javax.faces.component.UIComponent
javax.faces.component.UIComponent.StateMap, javax.faces.component.UIComponent.StateMapEntry
 
Field Summary
static java.lang.String COMPONENT_TYPE
          The standard component type for this component.
static java.lang.String RENDERER_TYPE
           
 
Fields inherited from class com.ibm.xsp.component.UICommandEx2
COMPONENT_FAMILY, EXEC_COMPLETE, EXEC_PARTIAL, MODE_COMPLETE, MODE_NOREFRESH, MODE_PARTIAL
 
Fields inherited from class javax.faces.component.UIComponentBase
EMPTY_ITERATOR
 
Fields inherited from class javax.faces.component.UIComponent
_xspStateId
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
UIEventHandler()
          Abstract Event Handler used to add event handling behaviour to its parent component.
 
Method Summary
 void addFor(java.lang.String id)
          Add an id of a control that this event handler is for
 void addHandler(ClientEventHandler handler)
           Set the value of the handlers property.
 void addParameter(Parameter parameter)
          Add a parameter
 void broadcast(javax.faces.event.FacesEvent event)
           
 void changedParent(javax.faces.context.FacesContext context, javax.faces.component.UIComponent oldParent, javax.faces.component.UIComponent newParent)
           
 void encodeBegin(javax.faces.context.FacesContext context)
           
 javax.faces.el.MethodBinding getAction()
           
 java.lang.String getEvent()
           Return the value of the event property.
 java.util.List<java.lang.String> getFor()
          Return the list of control ids that this event handler is for
 ClientEventHandler[] getHandlers()
           Return the value of the handlers property.
 java.util.List<Parameter> getParameters()
          Return the list of parameters
 javax.faces.el.MethodBinding getScript()
           The MethodBinding that, when invoked, yields the literal outcome value.
 boolean isSubmit()
          JavaScript Code to be executed on the client side.
protected  boolean isSuccessOutcome()
           
 void queueEvent(javax.faces.event.FacesEvent event)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setEvent(java.lang.String event)
           Set the value of the event property.
 void setScript(javax.faces.el.MethodBinding script)
           
 void setSubmit(boolean submit)
           Set the value of the submit property.
 
Methods inherited from class com.ibm.xsp.component.UICommandEx2
doNavigation, doSave, getExecId, getExecMode, getFamily, getOnComplete, getOnError, getOnStart, getRefreshId, getRefreshMode, isDisableValidators, isNavigate, isPartialRefresh, isSave, setDisableValidators, setExecId, setExecMode, setNavigate, setOnComplete, setOnError, setOnStart, setRefreshId, setRefreshMode, setSave
 
Methods inherited from class javax.faces.component.UICommand
addActionListener, getActionListener, getActionListeners, getValue, isImmediate, removeActionListener, setAction, setActionListener, setImmediate, setValue
 
Methods inherited from class javax.faces.component.UIComponentBase
_xspCleanTransientData, _xspGetReadOnlyObj, _xspGetRendererData, _xspRemoveReadOnlyObj, _xspRemoveRendererData, _xspSetIdUnchecked, _xspSetReadOnlyObj, _xspSetRendererData, addFacesListener, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
_xspGetStateId, _xspGetStateMap, _xspRestoreAttribute, _xspRestoreState, _xspSaveState, invokeOnComponent, isVisitable, markInitialState, setControlState, visitTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_TYPE

public static final java.lang.String COMPONENT_TYPE

The standard component type for this component.

See Also:
Constant Field Values

RENDERER_TYPE

public static final java.lang.String RENDERER_TYPE
See Also:
Constant Field Values
Constructor Detail

UIEventHandler

public UIEventHandler()
Abstract Event Handler used to add event handling behaviour to its parent component. Used to execute both client side and server side functionality.

Method Detail

addParameter

public void addParameter(Parameter parameter)
Add a parameter

Parameters:
parameter -

getParameters

public java.util.List<Parameter> getParameters()
Return the list of parameters


addFor

public void addFor(java.lang.String id)
Add an id of a control that this event handler is for

Parameters:
parameter -

getFor

public java.util.List<java.lang.String> getFor()
Return the list of control ids that this event handler is for


getScript

public javax.faces.el.MethodBinding getScript()

The MethodBinding that, when invoked, yields the literal outcome value.


setScript

public void setScript(javax.faces.el.MethodBinding script)

getEvent

public java.lang.String getEvent()

Return the value of the event property. Contents:

the type of event that this behaviour is to attach to on its parent (typically onChange, or onClick).


setEvent

public void setEvent(java.lang.String event)

Set the value of the event property.


getHandlers

public ClientEventHandler[] getHandlers()

Return the value of the handlers property. Contents:

JavaScript Code to be executed on the client side. This is defined as a collection of Handler complex properties, each of which define the renderer they're to be used with and the script language used. There can be multiple event handlers defined.


addHandler

public void addHandler(ClientEventHandler handler)

Set the value of the handlers property.


isSubmit

public boolean isSubmit()
JavaScript Code to be executed on the client side. This is defined as a collection of Handler complex types, each of which define the renderer they're to be used with and the script language used. There can be multiple event handlers defined.

Returns:

setSubmit

public void setSubmit(boolean submit)

Set the value of the submit property.


isSuccessOutcome

protected boolean isSuccessOutcome()

getAction

public javax.faces.el.MethodBinding getAction()
Specified by:
getAction in interface javax.faces.component.ActionSource
Overrides:
getAction in class javax.faces.component.UICommand

queueEvent

public void queueEvent(javax.faces.event.FacesEvent event)
Overrides:
queueEvent in class javax.faces.component.UICommand

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class UICommandEx2

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class UICommandEx2

changedParent

public void changedParent(javax.faces.context.FacesContext context,
                          javax.faces.component.UIComponent oldParent,
                          javax.faces.component.UIComponent newParent)
Specified by:
changedParent in interface FacesParentReliantComponent

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context)
                 throws java.io.IOException
Overrides:
encodeBegin in class UICommandEx2
Throws:
java.io.IOException

broadcast

public void broadcast(javax.faces.event.FacesEvent event)
               throws javax.faces.event.AbortProcessingException
Overrides:
broadcast in class javax.faces.component.UICommand
Throws:
javax.faces.event.AbortProcessingException