org.apache.shale.validator.faces
Class ValidatorInputRenderer

java.lang.Object
  extended by javax.faces.render.Renderer
      extended by org.apache.shale.validator.faces.ValidatorInputRenderer

public class ValidatorInputRenderer
extends javax.faces.render.Renderer

This renderer is a hybrid renderer decorator that is dynamically registered by the ValidatorRenderKit for component renderers in the "javax.faces.Input" family.


Field Summary
static String VALIDATOR_CLIENTIDS_ATTR
          This constant is the name of a reserved attribute that will hold a Map of clientId's for the component.
 
Constructor Summary
ValidatorInputRenderer(javax.faces.render.Renderer defaultRenderer)
          Overloaded constructor is passed the original Renderer.
 
Method Summary
 String convertClientId(javax.faces.context.FacesContext context, String id)
          
 void decode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          
 void encodeBegin(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          This override captures the clientId of the target component before passing on to the original renderer.
 void encodeChildren(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          
 void encodeEnd(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
          
 Object getConvertedValue(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
          
 boolean getRendersChildren()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATOR_CLIENTIDS_ATTR

public static final String VALIDATOR_CLIENTIDS_ATTR

This constant is the name of a reserved attribute that will hold a Map of clientId's for the component.

See Also:
Constant Field Values
Constructor Detail

ValidatorInputRenderer

public ValidatorInputRenderer(javax.faces.render.Renderer defaultRenderer)

Overloaded constructor is passed the original Renderer.

Parameters:
defaultRenderer - The Renderer we should wrap
Method Detail

convertClientId

public String convertClientId(javax.faces.context.FacesContext context,
                              String id)

Overrides:
convertClientId in class javax.faces.render.Renderer

decode

public void decode(javax.faces.context.FacesContext context,
                   javax.faces.component.UIComponent component)

Overrides:
decode in class javax.faces.render.Renderer

encodeBegin

public void encodeBegin(javax.faces.context.FacesContext context,
                        javax.faces.component.UIComponent component)
                 throws IOException

This override captures the clientId of the target component before passing on to the original renderer. The clientId is added to a Map that is used by the org.apache.shale.component.ValidatorScript component for adding client side JavaScript validation. This hook is needed when the CommonsValidator is added to a UIData subclass. The components in this class are not unique per row so the clientId can only be captured during the rendering process. The Map also contains a snapshot of validator var arguments that contain value binding expressions. This snapshot of state at renderering is used by the client side JavaScript. The snapshot allows client side validation in UIData components.

Overrides:
encodeBegin in class javax.faces.render.Renderer
Parameters:
context - FacesContext for the current request
component - UIComponent being rendered
Throws:
IOException - if an input/output error occurs

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context,
                           javax.faces.component.UIComponent component)
                    throws IOException

Overrides:
encodeChildren in class javax.faces.render.Renderer
Throws:
IOException

encodeEnd

public void encodeEnd(javax.faces.context.FacesContext context,
                      javax.faces.component.UIComponent component)
               throws IOException

Overrides:
encodeEnd in class javax.faces.render.Renderer
Throws:
IOException

getConvertedValue

public Object getConvertedValue(javax.faces.context.FacesContext context,
                                javax.faces.component.UIComponent component,
                                Object value)
                         throws javax.faces.convert.ConverterException

Overrides:
getConvertedValue in class javax.faces.render.Renderer
Throws:
javax.faces.convert.ConverterException

getRendersChildren

public boolean getRendersChildren()

Overrides:
getRendersChildren in class javax.faces.render.Renderer


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.