public class ValidatorScript
extends javax.faces.component.UIComponentBase
A JSF component that encodes JavaScript for
all client-side validations specified in the same
JSP page (with s:commonsValidator.
$Id: ValidatorScript.java 464373 2006-10-16 04:21:54Z rahul $
| Constructor and Description |
|---|
ValidatorScript() |
| Modifier and Type | Method and Description |
|---|---|
void |
encodeBegin(javax.faces.context.FacesContext context)
Begin encoding for this component.
|
String |
findForm(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
Traverses up the tree looking for the owning form.
|
String |
getFamily()
Returns the component's family.
|
String |
getFunctionName()
Return the value of the
functionName property. |
String |
getRendererType()
The component renders itself; therefore, this
method returns null.
|
void |
restoreState(javax.faces.context.FacesContext context,
Object state)
Restore the state of this component.
|
Object |
saveState(javax.faces.context.FacesContext context)
Save the state of this component.
|
void |
setFunctionName(String functionName)
Set the value of the
functionName property. |
void |
writeJavaScriptParams(javax.faces.context.ResponseWriter writer,
javax.faces.context.FacesContext context,
String id,
CommonsValidator v)
Writes the JavaScript parameters for the client-side
validation code.
|
addFacesListener, broadcast, decode, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendersChildren, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBindingpublic String getRendererType()
The component renders itself; therefore, this method returns null.
getRendererType in class javax.faces.component.UIComponentBasenull component handles rendereringpublic String getFamily()
Returns the component's family. In this case, the component is not associated with a family, so this method returns null.
getFamily in class javax.faces.component.UIComponentpublic String getFunctionName()
Return the value of the functionName property.
public void setFunctionName(String functionName)
Set the value of the functionName property.
functionName - The new function namepublic void restoreState(javax.faces.context.FacesContext context,
Object state)
Restore the state of this component.
restoreState in interface javax.faces.component.StateHolderrestoreState in class javax.faces.component.UIComponentBasecontext - FacesContext for the current requeststate - State to be restoredpublic Object saveState(javax.faces.context.FacesContext context)
Save the state of this component.
saveState in interface javax.faces.component.StateHoldersaveState in class javax.faces.component.UIComponentBasecontext - FacesContext for the current requestpublic void writeJavaScriptParams(javax.faces.context.ResponseWriter writer,
javax.faces.context.FacesContext context,
String id,
CommonsValidator v)
throws IOException
Writes the JavaScript parameters for the client-side validation code.
writer - A response writercontext - The FacesContext for this requestid - The clientId of the owning componentv - The Commons validatorIOException - if an input/output error occurspublic String findForm(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
Traverses up the tree looking for the owning form.
Returns the parent UIForm or empty string
if one is not found.
context - FacesContext for the current requestcomponent - UIForm parent of the component.public void encodeBegin(javax.faces.context.FacesContext context)
throws IOException
Begin encoding for this component. This method finds all Commons validators attached to components in the current component hierarchy and writes out JavaScript code to invoke those validators, in turn.
encodeBegin in class javax.faces.component.UIComponentBasecontext - The FacesContext for this requestIOException - if an input/output error occursCopyright © 2004-2013 Apache Software Foundation. All Rights Reserved.