C H A P T E R  2

containerView


<jato:containerView>

A containerView declares use of a ContainerView peer instance available from the view bean or one of its child ContainerViews. All View or DisplayField references enclosed by this tag are assumed to reference children of the associated ContainerView instance, and their name attributes are resolved within the namespace of the parent container. This tag is only valid when nested inside a useViewBean, tiledView, or another containerView tag.

The use of the containerView 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 containerView tag, the implicit scripting variable currentContainerView is set to the ContainerView instance referred to by this tag.

The useViewBean and tiledView tags are special cases of the containerView tag, adding additional behavior to the basic behavior defined by this tag.

Example:

<jato:containerView name="header">

...

</jato:containerView>

Attribute Name

Description

Notes

id

Specifies a name used to identify the implicit scripting variable that will refer to the ContainerView 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.

 

name

The name of the ContainerView 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 ContainerView 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.ContainerView