org.apache.myfaces.custom.jslistener
Class AbstractJsValueChangeListener

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.apache.myfaces.custom.jslistener.AbstractJsValueChangeListener
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.PartialStateHolder, javax.faces.component.StateHolder, javax.faces.event.ComponentSystemEventListener, javax.faces.event.FacesListener, javax.faces.event.SystemEventListenerHolder
Direct Known Subclasses:
JsValueChangeListener

public abstract class AbstractJsValueChangeListener
extends javax.faces.component.UIComponentBase

Value change listener on client side.

This component replicates the 'Value Change Listener' functionality on the client side. It can be used when the user would like a change in the value of one control to trigger off changes in the states of other controls. One or more Javascript Listeners can be nested within the source control (a control belonging to the 'javax.faces.Input' family). When the value of the source control is modified, the listeners are triggered and the states of the target controls modified.

Unless otherwise specified, all attributes accept static values or EL expressions.

Since:
1.1.7
Version:
$Revision: 691856 $ $Date: 2008-09-03 21:40:30 -0500 (Wed, 03 Sep 2008) $
Author:
Martin Marinschek (latest modification by $Author: lu4242 $)

Field Summary
static java.lang.String COMPONENT_FAMILY
           
static java.lang.String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIComponent
BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, VIEW_LOCATION_KEY
 
Constructor Summary
AbstractJsValueChangeListener()
           
 
Method Summary
abstract  java.lang.String getBodyTagEvent()
          Events are triggered by the 'onchange' event of the source control.
abstract  java.lang.String getExpressionValue()
          the javascript expression to evaluate.
abstract  java.lang.String getFor()
          for - the id of the target control
abstract  java.lang.String getProperty()
          The result of the evaluated expression is assigned to the specified property of the target control
 
Methods inherited from class javax.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, initialStateMarked, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, visitTree
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getFamily, getListenersForEventClass, getNamingContainer, getResourceBundleMap, getStateHelper, getStateHelper, getValueExpression, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEvent
 
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
See Also:
Constant Field Values

COMPONENT_FAMILY

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

AbstractJsValueChangeListener

public AbstractJsValueChangeListener()
Method Detail

getFor

public abstract java.lang.String getFor()
for - the id of the target control


getExpressionValue

public abstract java.lang.String getExpressionValue()
the javascript expression to evaluate. The keyword '$srcElem' resolves to the source control and the keyword '$destElem' resolves to the target control


getProperty

public abstract java.lang.String getProperty()
The result of the evaluated expression is assigned to the specified property of the target control


getBodyTagEvent

public abstract java.lang.String getBodyTagEvent()
Events are triggered by the 'onchange' event of the source control. Here, an additional event can be specified (onload?). If specified this JavaScript event will be inserted in the body tag. JavaScript code will be the same like it is rendered in the parent component.



Copyright © 2011 The Apache Software Foundation. All Rights Reserved.