edu.nrao.sss.webapp.faces.component
Class ForEach

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIData
              extended by edu.nrao.sss.webapp.faces.component.ForEach
All Implemented Interfaces:
NamingContainer, StateHolder

public class ForEach
extends UIData

This class implements a ForEach loop tag by partially overriding the default table renderer. By partially, I mean those parts of the rendering that dealt solely with rendering UIColumns are overridden or replaced to deal with all child elements and no table tags are written. This allows us to borrow the default renderer's handling of child id's and the data model and all that.


Field Summary
 
Fields inherited from class javax.faces.component.UIData
COMPONENT_FAMILY, COMPONENT_TYPE
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
ForEach()
          empty constructor
 
Method Summary
 void encodeBegin(FacesContext context)
          This method is overridden to prevent the default renderer from writing out table tags.
 void encodeChildren(FacesContext context)
          Overridden to render our child UI components even though they are not UIColumns.
 void encodeEnd(FacesContext context)
          Overridden to prevent end table tag output
 void processDecodes(FacesContext context)
          Overridden to properly decode our child components
 void processUpdates(FacesContext context)
          Overridden to properly decode our child components
 void processValidators(FacesContext context)
          Overridden to properly decode our child components
 
Methods inherited from class javax.faces.component.UIData
broadcast, getClientId, getFamily, getFirst, getFooter, getHeader, getRowCount, getRowData, getRowIndex, getRows, getValue, getVar, isRowAvailable, queueEvent, restoreState, saveState, setFirst, setFooter, setHeader, setRowIndex, setRows, setValue, setValueBinding, setVar
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, decode, findComponent, getAttributes, getChildCount, getChildren, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForEach

public ForEach()
empty constructor

Method Detail

encodeBegin

public void encodeBegin(FacesContext context)
                 throws IOException
This method is overridden to prevent the default renderer from writing out table tags. This is done by temporarily replacing the ResponseWriter in context, calling super (because super must be called to correctly handle some model interaction), and then putting the real writer back.

Overrides:
encodeBegin in class UIData
Throws:
IOException

encodeEnd

public void encodeEnd(FacesContext context)
               throws IOException
Overridden to prevent end table tag output

Overrides:
encodeEnd in class UIData
Throws:
IOException

encodeChildren

public void encodeChildren(FacesContext context)
                    throws IOException
Overridden to render our child UI components even though they are not UIColumns.

Overrides:
encodeChildren in class UIComponentBase
Throws:
IOException

processDecodes

public void processDecodes(FacesContext context)
Overridden to properly decode our child components

Overrides:
processDecodes in class UIData

processValidators

public void processValidators(FacesContext context)
Overridden to properly decode our child components

Overrides:
processValidators in class UIData

processUpdates

public void processUpdates(FacesContext context)
Overridden to properly decode our child components

Overrides:
processUpdates in class UIData


Copyright © 2009. All Rights Reserved.