com.taggercat.template.tags
Class SetAllAttributesVarTag

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

public class SetAllAttributesVarTag
extends javax.servlet.jsp.tagext.TagSupport

This tag builds a comma separated list of all field names in the current entity and sets it as a request scope attribute with the name: allSelectedOrDefaultFields.

Additionally, only fields that have their "Layout by Default" attribute set in the extended meta data are included in the list.

The created field list can be then be used as the default field selection list for most of the template tags, and iterators when the user has not explicitly selected the fields for a template.

If the user has explicitly set the selected field list, then this tag just sets the allSelectedOrDefaultFields request scope attribute to that list.

Therefore, in most templates you can replace:

<t:forEachField fieldNames="${param.selectedFields}" varStatus="status" >
with:
<t:forEachField fieldNames="${allSelectedOrDefaultFields}" varStatus="status" >

The default name of the request parameter for the user's selected template field list is selectedFields. If another parameter name is used, it can be specified with in tag's fieldListParamName attribute.

See Also:
Serialized Form
 

Field Summary
 
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
SetAllAttributesVarTag()
           
 
Method Summary
 int doEndTag()
           
 int doStartTag()
          Sets the two page scope variables
 void setAllFields(boolean allFields)
           
 void setFieldListParamName(java.lang.String fieldListParamName)
           
 void setSelectedFields(java.lang.String selectedFields)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetAllAttributesVarTag

public SetAllAttributesVarTag()
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 javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Sets the two page scope variables

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspException
Returns:
SKIP_BODY this tag does not create a body

setFieldListParamName

public void setFieldListParamName(java.lang.String fieldListParamName)

setAllFields

public void setAllFields(boolean allFields)

setSelectedFields

public void setSelectedFields(java.lang.String selectedFields)