Formal vs. Informal Parameters

Tapestry components have two types of parameters: formal and informal.

Formal parameters are parameters defined in the component specification. Each formal parameter has a specific (case sensitive) name and may be required or optional.

In many cases, there is a one-to-one mapping between a Tapestry component and a specific HTML tag. For example, Body and <body>, Form and <form>, etc. In other cases, a Tapestry component produces a known single HTML tag. For example, ActionLink, DirectLink, PageLink and ServiceLink all produce an <a> tag.

To support truly rich interfaces, it is often necessary to specify additional attributes of the HTML tags; usually this means setting the class of a tag so as to get visual properties from a stylesheet. In other cases, display attributes may be specified inline (this is often the case with attributes related to display width and height, since CSS support for these properties are inconsistent between the major HTML 4.0 browsers).

In theory, these components could define additional formal parameters for each possible HTML attribute ... but there are a huge number of possible attributes, many of which are specific to a particular browser.

Instead, Tapestry has the concept of an informal parameter. This is an "additional" parameter, not specified in the component's specification. In most cases, where informal parameters are allowed, they are added as additional HTML attributes (there are a few special exceptions, such as the Script component).

Informal parameters do have some limitations. Informal parameters that conflict with the names of any formal parameters, or with any of the HTML attributes generated directly by the component, are silently ommitted. The comparison is case-insensitve. Thus, for a DirectLink component, you can not change the href attribute, even if you supply a Href (or other variation) informal parameter.

Not all Tapestry components even allow informal parameters; this is explicitly stated in the component specification.

[Note]Informal Parameters that are Assets

Tapestry includes a special case when an informal parameter is actually an asset. The URL for the asset is determined and that is the value supplied for the attribute.