com.taggercat.template.tags
Class ForEachFieldTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.taggercat.template.tags.AbstractDataFieldTag
          extended by com.taggercat.template.tags.ForEachFieldTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class ForEachFieldTag
extends AbstractDataFieldTag

This tag is used to iterate over the field list. Upon each iteration the the following objects are exposed:

  1. the field's metaProperty -> request scope
  2. the current fieldName -> page scope
  3. loop status -> page scope

Example usage:

You should use this tag rather than the JSTL tags such as:

when you need to expose the field's metaProperty object on the request scope before it is dispatched with the DataField tags.

The name of the loop status variable is specified in the tag's varStatus attribute.

See Also:
Serialized Form
 

Nested Class Summary
 class ForEachFieldTag.LoopStatus
          Loop Status object
 
Field Summary
 
Fields inherited from class com.taggercat.template.tags.AbstractDataFieldTag
TAG_GEN_CONFIG_CACHE_KEY, TAG_GEN_CONFIG_PREFIX
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ForEachFieldTag()
           
 
Method Summary
 int doAfterBody()
           
 int doEndTag()
           
 int doStartTag()
          Sends the value of the data field to the page.
 java.lang.Object getCurrent()
          Gets the current busObjectAttribute object
 ForEachFieldTag.LoopStatus getLoopStatus()
          A singleton to get the loop status object associated with this tag
 void init()
           
 void release()
           
 void setFieldNames(java.lang.String fieldNames)
          Sets the field names ( as a comma separated list )
 void setVarStatus(java.lang.String statusId)
          Sets the 'varStatus' attribute.
 
Methods inherited from class com.taggercat.template.tags.AbstractDataFieldTag
setEntityName, setEntityObjectAttribute, setPrettyPrint, setPropertyName
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForEachFieldTag

public ForEachFieldTag()
Method Detail

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class AbstractDataFieldTag
Throws:
javax.servlet.jsp.JspException

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Description copied from class: AbstractDataFieldTag
Sends the value of the data field to the page.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class AbstractDataFieldTag
Throws:
javax.servlet.jsp.JspException
Returns:
SKIP_BODY

doAfterBody

public int doAfterBody()
                throws javax.servlet.jsp.JspException
Specified by:
doAfterBody in interface javax.servlet.jsp.tagext.IterationTag
Overrides:
doAfterBody in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

init

public void init()

getCurrent

public java.lang.Object getCurrent()
Gets the current busObjectAttribute object

Returns:
the current busObjectAttribute object

getLoopStatus

public ForEachFieldTag.LoopStatus getLoopStatus()
A singleton to get the loop status object associated with this tag

Returns:
the loop status object

setFieldNames

public void setFieldNames(java.lang.String fieldNames)
Sets the field names ( as a comma separated list )

Parameters:
fieldNames - the field names to iterate over

setVarStatus

public void setVarStatus(java.lang.String statusId)
Sets the 'varStatus' attribute.

Parameters:
statusId - Name of the exported scoped variable storing the status of the iteration.

release

public void release()
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class javax.servlet.jsp.tagext.TagSupport