com.taggercat.template.tags
Class ForEachFieldListTag
java.lang.Object
javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.tagext.BodyTagSupport
com.taggercat.template.tags.ForEachFieldListTag
- All Implemented Interfaces:
- java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag
public class ForEachFieldListTag
- extends javax.servlet.jsp.tagext.BodyTagSupport
This tag is used to iterate over n number of field list sets. Where
the field lists sets are passed in multi-value request parameters.
This tag could be called "For Each Multi-Value Field List Parameter".
This tag would typically be used to process tempaltes where multiple
sets of field lists are selected for including in the generated
templates. For example, you can use this tag to process a template that
has multiple field sections separated by a section header.
Unlike regular templates where multiple field lists could be assigned
to unique parameter names, these field lists are assigned to the same
parameter name. Therefore, they are processed as multi-value request
parameters.
Additionally, each field list parameter value can have a number of
other corresponding multi-value parameters. For example, each field list
might have an associated Caption, a field type list, image name etc.
As this tag iterates over the field set parameter values, it
exposes current field set as a page scope attribute under the same
name. Additionally, the other named corresponding multi-value parameter
value are exposed on page scope attributes.
The requirement is that the associated parameter names are in the same
order in each set.
If a field set parameter has the value equal to "all" or "required" then all
data object attributes defined with the "Is layout by default" attribute set
to true will be assigned to the field set.
For example:
http://localhost/JSPTemplates/MultiTest.jsp?selectedFields=name,account&selectedFields=address,state&selectedFieldsTypes=a,b&tselectedFieldsTypes=x,y&caption=First_Field_Set&caption=Second_Field_Set
Passes in two field lists; named and corresponding field types and
captions.
For each iteration ( field set), this tag sets the current field set on
the pageScope attribute named: selectedFields. The current caption is
set on the pageScope attribute named: caption
- See Also:
- Serialized Form
-
| Fields inherited from interface javax.servlet.jsp.tagext.BodyTag |
EVAL_BODY_BUFFERED, EVAL_BODY_TAG |
| 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 |
| Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport |
doInitBody, getBodyContent, getPreviousOut, release, setBodyContent |
| 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 |
| Methods inherited from interface javax.servlet.jsp.tagext.Tag |
getParent, setPageContext, setParent |
ForEachFieldListTag
public ForEachFieldListTag()
doEndTag
public int doEndTag()
throws javax.servlet.jsp.JspException
- Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
doEndTag in class javax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
doStartTag
public int doStartTag()
throws javax.servlet.jsp.JspException
- Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
doStartTag in class javax.servlet.jsp.tagext.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
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.BodyTagSupport
- Throws:
javax.servlet.jsp.JspException
setFieldSetParamName
public void setFieldSetParamName(java.lang.String fieldSetParamName)
setVarParamNames
public void setVarParamNames(java.lang.String varParamNames)
getLoopStatus
public ForEachFieldListTag.LoopStatus getLoopStatus()
- A singleton to get the loop status object associated
with this tag
- Returns:
- the loop status object
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.