Looping Tags

JETT has several built-in looping tags. These tags are used to display repeating content, such as indexed content or Collections. Normally, the block's content is copied downward to display repeating content. Other content that is below the block is shifted downward to make room.

All looping tags are defined by classes that subclass the abstract class BaseLoopTag, which itself subclasses the abstract class BaseTag. These are JETT's built-in looping tags:

All looping tags support several common attributes:

Attributes

  • All looping tags support all base tag attributes.
  • copyRight: Boolean Optional. Normally, content below the block is shifted downward to make room for the copied blocks. But if this attribute is true, then this will shift content to the right of the block out of the way, and the block will be copied to the right instead of downward. Default: false (downward).
  • fixed: Boolean Optional. If true, then the tag will assume that the proper space is present into which the blocks will be copied, so it will NOT shift other content out of the way to make room for the copied blocks. Default: false (shifting content out of the way will occur).
  • pastEndAction: String Optional. If specified, then its value controls what happens to blocks when it is beyond the end of iteration on a Collection. The circumstances that allow extra blocks beyond the end of a Collection are explained in the page for each looping tag, when they arise. Here are the possible values:
    • clear This works just like the "elseAction" attribute of the if tag: remove the contents of the cells. This is the default.
    • remove This works just like the "elseAction" attribute of the if tag: remove the cells, including cell contents, formatting, borders, and merged regions.
    • replaceExpr Don't delete the contents of the entire cell. Replace any expressions that reference collections that have been exhausted with the result of evaluating the replaceValue attribute.
  • replaceValue: String Optional. If the pastEndAction is replaceExpr, then all expressions that reference collections that have been exhausted are replaced with this value. This is ignored if pastEndAction is not replaceExpr. Default: an empty string.
  • groupDir: String Optional. This works just like the "groupDir" attribute of the group tag: if specified, then JETT will create an Excel Group (Outline) out of the resultant rows or columns. Here are the possible values:
    • rows Create an Excel Group (Outline) out of the resultant rows.
    • cols Create an Excel Group (Outline) out of the resultant columns.
    • none Do not create an Excel Group (Outline). This is the default.
  • collapse: boolean Optional. This works just like the "collapse" attribute of the group tag: This determines whether the Excel Group (Outline) created is in a collapsed state. The default is false (not collapsed).
  • onLoopProcessed: TagLoopListener Optional. Specify a TagLoopListener that will be called every time a loop's processing has finished. Alternatively, a fully-qualified Java class name may be specified here, and JETT will instantiate one, provided it has a no-argument public constructor.
  • varStatus: String Optional. This specifies a variable name for an object to be exposed in the beans map. This object exposes the 0-based iteration index and whether it's the first iteration or the last iteration. Use the "index" (int), "first" (boolean), and "last" (boolean) properties.