|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.rave.web.ui.component.util.descriptors.LayoutElementBase
com.sun.rave.web.ui.component.util.descriptors.LayoutForEach
public class LayoutForEach
This class defines a LayoutForEach LayoutElement
. The
LayoutForEach provides the functionality necessary to iteratively
display a portion of the layout tree. The list property contains
the List
of items to iterate over.
VariableResolver
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
AFTER_LOOP
This is the event "type" for Handler elements to be
invoked after this LayoutForEach is processed (outside loop). |
static java.lang.String |
BEFORE_LOOP
This is the event "type" for Handler elements to be
invoked before this LayoutForEach is processed (outside loop). |
Fields inherited from class com.sun.rave.web.ui.component.util.descriptors.LayoutElementBase |
---|
AFTER_ENCODE, BEFORE_ENCODE, ENCODE |
Constructor Summary | |
---|---|
LayoutForEach(LayoutElement parent,
java.lang.String listBinding,
java.lang.String key)
Constructor. |
Method Summary | |
---|---|
void |
encode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
This implementation overrides the parent encode
method. |
protected boolean |
encodeThis(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent component)
This method always returns true. |
protected java.util.List |
getList(javax.faces.context.FacesContext context)
This method evaluates the list binding for this LayoutForEach . |
protected void |
setCurrentForEachValue(javax.faces.context.FacesContext context,
java.lang.Object value,
int index,
java.lang.String key)
This method sets the Object that is currently being
processed by this LayoutForEach . |
Methods inherited from class com.sun.rave.web.ui.component.util.descriptors.LayoutElementBase |
---|
addChildLayoutElement, createHandlerContext, dispatchHandlers, dispatchHandlers, encodeChild, getChildLayoutElements, getHandlers, getHandlers, getHandlersByTypeMap, getId, getLayoutDefinition, getParent, getUnevaluatedId, resolveValue, setHandlers, setHandlersByTypeMap, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sun.rave.web.ui.component.util.descriptors.LayoutElement |
---|
addChildLayoutElement, dispatchHandlers, dispatchHandlers, getChildLayoutElements, getHandlers, getId, getLayoutDefinition, getParent, getUnevaluatedId, setHandlers |
Field Detail |
---|
public static final java.lang.String AFTER_LOOP
This is the event "type" for
Handler
elements to be
invoked after this LayoutForEach is processed (outside loop).
public static final java.lang.String BEFORE_LOOP
This is the event "type" for
Handler
elements to be
invoked before this LayoutForEach is processed (outside loop).
Constructor Detail |
---|
public LayoutForEach(LayoutElement parent, java.lang.String listBinding, java.lang.String key)
parent
- The parent LayoutElement
listBinding
- The List
to iterate overkey
- The ServletRequest
attribute key
used to store the object being processedMethod Detail |
---|
protected boolean encodeThis(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component)
This method always returns true. The condition is based on an
Iterator.hasNext()
call instead of here because
the #encode(FacesContext, TemplateComponent)
method
evaluates this and then calls the super. Performing the check
here would cause the condition to be evaluated twice.
encodeThis
in class LayoutElementBase
context
- The FacesContextcomponent
- The UIComponent
protected java.util.List getList(javax.faces.context.FacesContext context)
This method evaluates the list binding for this
LayoutForEach
. This is expected to evaulate to a
List
object. If it doesn't, this method will throw a
NullPointerException
(if it evaulates to
null
), or an IllegalArgumentException
if
it doesn't evaluate to a List
.
context
- The FacesContext
return The List
of objects to iterate overprotected void setCurrentForEachValue(javax.faces.context.FacesContext context, java.lang.Object value, int index, java.lang.String key)
This method sets the Object
that is currently being
processed by this LayoutForEach
. This implementation
stores this value in the request attribute map undert the key
provided to this LayoutForEach
.
As an added convenience, this method will also set an attribute
that contains the current index number. The attribute key will be
the same key the Object
is stored under plus "-index".
The index is stored as a String.
context
- The FacesContext
value
- The Object
to storeindex
- The current index number of the Object
public void encode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component) throws java.io.IOException
This implementation overrides the parent encode
method. It does this to cause the encode process to loop as long
as there are more List
entries to process.
encode
in interface LayoutElement
encode
in class LayoutElementBase
context
- The FacesContextcomponent
- The UIComponent
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |