When using Tapestry, an important aspect of your work is to leverage the properties exposed by the various objects within Tapestry. A page has properties (inherited from base classes such as AbstractComponent and BasePage ) and contains components and other objects with more properties. Pages are connected to an engine, which exports its own set of properties. This table is a quick guide to the most common objects and their properties.
Property name | Defining class | Property type | Description |
---|---|---|---|
assets | IComponent | Map of IAsset | Localized assets as defined in the component's specification. |
beans | IComponent | IBeanProvider | Used to access beans defined using the <bean> specification element. |
bindingNames | IComponent | Collection of String | The names of all formal and informal parameter bindings for the component. |
bindings | IComponent | Map of IBinding | All bindings (for both formal and informal parameters) for this component, keyed on the parameter name. |
body | AbstractComponent | IRender [] | The body of the component: the text (as IRender ) and components (which inherit from IRender ) that the component directly encloses within its container's template. |
bodyCount | AbstractComponent | int | The active number of elements in the body property array. |
components | IComponent | Map of IComponent | All components contained by this component, keyed on the component id. |
changeObserver | IPage | ChangeObserver | An object that recieves notifications about changes to persistent page properties. |
classResolver | IEngine | ClassResolver | Object responsible for locating classes and classpath resources. |
clientId | IComponent | String | The component's client-side element id. |
componentMessagesSource | IEngine | IComponentMessagesSource | An object that allows components to find their set of localized messages. |
container | IComponent | IComponent | The page or component which contains this component. Pages will return null. |
disabled | IFormComponent | boolean | If true, the component should be disabled (and not respond to query parameters passed up in the request). |
displayName | IFormComponent | String | Localized string to be displayed as a label for the form control. Most implementations leave this undefined (as null). |
engine | IPage | IEngine | The engine to which the page is currently attached. |
extendedId | IComponent | String | An "extended" version of the idPath property that includes the name of the page containing the component as well. |
form | IFormComponent | IForm | The form which encloses the form control component. |
global | IEngine , IPage | Object | The Global object for the application. |
hasVisit | AbstractEngine | boolean | Returns true if the Visit object has been created, false initially. |
id | IComponent | String | The id of the component, which is unique within its container. In many cases, the framework may have assigned an automatically generated id. Pages do not have an id and return null. |
idPath | IComponent | String |
A sequence of id's used to locate a component within a page. A component
bar
within a component
foo
within a page will have an idPath of
foo.bar
. Pages return null.
|
listeners | AbstractComponent , AbstractEngine | ListenerMap | Used to map listener methods as objects that implement the IActionListener interface. |
locale | IEngine | Locale | The locale for the current client; this is used when loading pages from the page pool, or when instantiating new page instances. |
locale | IPage | Locale | The locale to which the page and all components within the page is localized. |
location | many | Location | The location that should be used with any error messages generated about the object. This is ultimately the file, line (and even column) of the template or specification file responsible for defining the object (be it a component, a page, or some other kind of object). |
messages | IComponent | Messages | Localized messages for the component. |
name | IFormComponent | String | The name, or element id, assigned to the form control by the IForm . This is set as the component renders (but the property can then be read after the component renders). |
namespace | IComponent | INamespace | The namespace containing the component. Components are always within some namespace, whether it is the default (application) namespace, the framework namespace, or a namespace for a component library. |
outputEncoding | AbstractPage | String | Output encoding for the page. |
page | IComponent | IPage | The page which ultimately contains the component. |
propertySource | IEngine | IPropertySource | Source for configuration properties. |
pageName | IPage | String | The fully qualified page name (possibly including a namespace prefix). |
pageSource | IEngine | IPageSource | The object used to obtain page instances. |
rendering | IComponent | boolean |
True if the component is actively rendering (inside it's
render()
method).
|
requestCycle | IPage | IRequestCycle | The request cycle to which the page is currently attached. |
scriptSource | IEngine | IScriptSource | Object that parses and caches script specifications. |
specification | IComponent | IComponentSpecification | The specification which defines this component. Often used to access meta data defined in the component's specification using the <meta> element. |
specification | IEngine | IApplicationSpecification | The specification for the application. |
specificationSource | IEngine | ISpecificationSource | Object responsible for reading and caching page and component specifications. |
visit | IEngine | Object | Returns the Visit object for the current client, or null if the Visit object has not yet been created. |
visit | IPage | Object | Returns the Visit object for the current client, creating it if necessary. |