Appendix A. Tapestry Object Properties

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 appendix is a quick guide to the most common objects and their properties.

Table A.1. Tapestry Object Properties

Property nameDefining classProperty typeDescription
activePageNamesBaseEngineCollection of StringNames of all pages for which a page recorder has been created.
assetsIComponentMap of IAsset Localized assets as defined in the component's specification.
beansIComponentIBeanProviderUsed to access beans defined using the <bean> specification element.
bindingNamesIComponentCollection of String The names of all formal and informal parameter bindings for the component.
bindingsIComponentMap of IBinding All bindings (for both formal and informal parameters) for this component, keyed on the parameter name.
bodyAbstractComponentIRender[] 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.
bodyCountAbstractComponentint The active number of elements in the body property array.
componentClassEnhancerIEngineIComponentClassEnhancer Object responsible for dynamic creation of enhanced subclasses of Tapestry pages and components.
componentsIComponentMap of IComponent All components contained by this component, keyed on the component id.
contextPathIEngineString The path, if any, for the web application context.
changeObserverIPageChangeObserverAn object that recieves notifications about changes to persistent page properties.
componentMessagesSourceIEngineIComponentMessagesSource An object that allows components to find their set of localized messages.
containerIComponentIComponent The page or component which contains this component. Pages will return null.
dataSqueezerIEngineDataSqueezerObject used to encode and decode arbitrary values into a URL while maintaining their type.
dirtyAbstractEngineboolean True if the engine has been (potentially) modified, and should be stored into the HttpSession.
disabledIFormComponentboolean If true, the component should be disabled (and not respond to query parameters passed up in the request).
displayNameIFormComponentString Localized string to be displayed as a label for the form control. Most implementations leave this undefined (as null).
engineIPageIEngineThe engine to which the page is currently attached.
extendedIdIComponentString An "extended" version of the idPath property that includes the name of the page containing the component as well.
formIFormComponentIForm The form which encloses the form control component.
globalIEngine, IPageObject The Global object for the application.
hasVisitAbstractEngineboolean Returns true if the Visit object has been created, false initially.
idIComponentString 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.
idPathIComponentStringA 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.
listenersAbstractComponent, AbstractEngineListenerMap Used to map listener methods as objects that implement the IActionListener interface.
localeIEngineLocale The locale for the current client; this is used when loading pages from the page pool, or when instantiating new page instances.
localeIPageLocale The locale to which the page and all components within the page is localized.
locationmanyILocation 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).
messagesIComponentIMessages Localized messages for the component.
nameIFormComponentString 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).
namespaceIComponentINamespaceThe 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.
outputEncodingAbstractPageString Output encoding for the page.
pageIComponentIPage The page which ultimately contains the component.
propertySourceIEngineIPropertySource Source for configuration properties.
pageNameIPageString The fully qualified page name (possibly including a namespace prefix).
pageSourceIEngineIPageSource The object used to obtain page instances.
poolIEnginePool Stores objects that are expensive to create.
requestCycleIPageIRequestCycle The request cycle to which the page is currently attached.
resetServiceEnabledIEngineboolean If true, the reset service is enabled. The reset service is disabled by default.
resourceResolverIEngineIResourceResolver Object responsible for locating classes and classpath resources.
scriptSourceIEngineIScriptSource Object that parses and caches script specifications.
servletPathIEngineString The URL path used to reference the application servlet (including the context path, if any).
specificationIComponentIComponentSpecification The specification which defines this component. Often used to access meta data defined in the component's specification using the <property> element.
specificationIEngineIApplicationSpecification The specification for the application.
specificationSourceIEngineISpecificationSourceObject responsible for reading and caching page and component specifications.
statefulIEngineboolean If true, then an HttpSession has been created for the client to store server-side state. Initially false.
templateSourceIEngineITemplateSource Object responsible for reading and caching page and component templates.
visitIEngineObject Returns the Visit object for the current client, or null if the Visit object has not yet been created.
visitIPageObject Returns the Visit object for the current client, creating it if necessary.