org.apache.myfaces.commons.renderOne
Class AbstractUIRenderOne

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by org.apache.myfaces.commons.renderOne.AbstractUIRenderOne
All Implemented Interfaces:
javax.faces.component.StateHolder

@JSFComponent(name="mc:renderOne",
              clazz="org.apache.myfaces.commons.renderOne.UIRenderOne",
              tagClass="org.apache.myfaces.commons.renderOne.UIRenderOneTag")
public abstract class AbstractUIRenderOne
extends javax.faces.component.UIComponentBase

Tag that allows rendering the first child either by index or the first rendered one.

A component that only renders the first child either by index or the first visible one..

Version:
$Revision: 1021615 $ $Date: 2010-10-11 22:45:18 -0500 (Mon, 11 Oct 2010) $
Author:
Andrew Robinson (latest modification by $Author: lu4242 $)

Field Summary
static String COMPONENT_FAMILY
           
static String COMPONENT_TYPE
           
 
Constructor Summary
AbstractUIRenderOne()
           
 
Method Summary
 void encodeChildren(javax.faces.context.FacesContext context)
           
 boolean getRendersChildren()
           
abstract  String getType()
          The filter type: first|index.
abstract  Integer getValue()
          The value valid for the type.
protected  Object selectFirstChildByIndex(Integer value)
           
protected  Object selectFirstChildOnly()
           
protected  Object selectOneChild()
           
abstract  void setType(String type)
           
abstract  void setValue(Integer value)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getValueBinding, isRendered, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
getFamily
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
See Also:
Constant Field Values

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values
Constructor Detail

AbstractUIRenderOne

public AbstractUIRenderOne()
Method Detail

getType

@JSFProperty
public abstract String getType()
The filter type: first|index. first: the first list value should evaluate to a Number or a value that can be parsed into an integer. index: A collection, array or comma-separated list of numbers. (Default: "first")

Returns:
the type

setType

public abstract void setType(String type)
Parameters:
type - the type to set

getValue

@JSFProperty
public abstract Integer getValue()
The value valid for the type. If this evaluates to null, the first child will be rendered. If the type is "first", this value will be ignored, as "first" always renders the first rendered item. If the type is "index", the value must be a number.

Returns:
the value

setValue

public abstract void setValue(Integer value)
Parameters:
value - the value to set

getRendersChildren

public boolean getRendersChildren()
Overrides:
getRendersChildren in class javax.faces.component.UIComponentBase
See Also:
UIComponentBase.getRendersChildren()

encodeChildren

public void encodeChildren(javax.faces.context.FacesContext context)
                    throws IOException
Overrides:
encodeChildren in class javax.faces.component.UIComponentBase
Throws:
IOException
See Also:
UIComponentBase.encodeChildren(javax.faces.context.FacesContext)

selectOneChild

protected Object selectOneChild()

selectFirstChildOnly

protected Object selectFirstChildOnly()

selectFirstChildByIndex

protected Object selectFirstChildByIndex(Integer value)


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