C H A P T E R  3

tiledView


<jato:tiledView>

A tiledView tag declares a block of body content which is evaluated and rendered repeatedly during the display of the JSP. The tiledView must be associated with a TiledView object available from the view bean or one of its child ContainerViews. Callbacks to the TiledView object control the display of the tiledView body content. A tiledView is particularly useful for displaying multiple rows an HTML table; however, a tiledView's usage is not restricted to dynamic HTML row generation.

The use of the tiledView tag causes a new scripting variable to be defined within the scope of the enclosed tag body. The name of this scripting variable is the value of the name attribute, or the name of the id attribute if specified. When processing a tiledView tag, the implicit scripting variables currentContainerView and currentTiledView are set to the TiledView instance referred to by this tag.

A tiledView tag can be considered a special case of containerView tag. This tag is only valid when nested inside a useViewBean, containerView, or another tiledView tag.

Example:

<jato:tiledView name="orderItems" maxTiles="10">

...

</jato:tiledView>

Attribute Name

Description

Notes

id

Specifies a name used to identify the implicit scripting variable that will refer to the TiledView instance. The name specified is case sensitive and shall conform to the current scripting language variable-naming conventions.

If not specified, the scripting variable is named with the value specified in the name attribute.

 

maxTiles

Valid values: positive number

Specifies the maximum number of times this TiledView will render its body content. This value will override the corresponding value in the TiledView object. If not specified, maxTiles is determined by the TiledView peer

RTExpr

name

The name of the TiledView peer instance as declared in its parent (a ContainerView, TiledView, or ViewBean).

This name may be a qualified view path, using forward slashes ("/") as delimiters. All components in the path except the last must refer to a ContainerView or a derivative of ContainerView (such as TiledView). Both relative and absolute paths are possible. If a name path begins with a forward slash, the name is assumed to be relative to the root view (the ViewBean). If the path does not begin with a forward slash, the name is assumed to refer to a child relative to the current container. Two dots ("..") may be used to refer to the container that is the parent of the current container.

Examples:

/header/orderList/customerName (absolute from root view)

orderList/customerName (relative to current container)

../footer/orderList/customerName (relative to parent)

Req, RTExpr

type

If specified, defines the type of the scripting variable defined within the scope of this tag. This allows the type of the scripting variable to be distinct from, but related to, that of the implementation class specified. The type is required to be either the specific TiledView class itself, a superclass of the class, or an interface implemented by the class specified. The object referenced is required to be of this type, otherwise a java.lang.ClassCastException shall occur at request time when the assignment of the object referenced to the scripting variable is attempted.

If unspecified, the scripting variable is declared to be of type <JATO package>.view.TiledView

 

reset

Valid values: "true" or "false"

A value of "true" specifies that the tag will call the TiledView's resetTileIndex() method immediately after invoking the beginDisplay() event. This will ensure that the view's primary model is properly reset for display.

If not specified, a value of "true" is assumed. Note, this is a change from previous versions of JATO. Previous versions never performed a reset, leaving this behavior up to the developer. It is expected that this change will provide more ease of use, while providing backward compatibility for the rare application that relied upon the previous default behavior.