Tapestry includes more than 65 built-in components and mixins. In addition, there are hundreds of Tapestry components freely available from others. Of course, Tapestry makes it trivially easy to create your own custom components, so if you don't see what you need, just develop them yourself.
Related Articles
Contents
Tapestry-provided Components
Most Tapestry-provided components are found in the org.apache.tapestry5.corelib.components package. Other components are included in the separate org.apache.tapestry5.kaptcha.components and org.apache.tapestry5.upload.components packages.
AJAX-specific Components
Main Article: Ajax and Zones
A special form of the Loop component that adds Ajax support to handle adding new rows and removing existing rows dynamically. | |
Used inside an AjaxFormLoop component to spur the addition or removal of a row. | |
Used to implement the progressive enhancement web design strategy; the component renders itself with a simplified initial content (i.e., "loading ...") and an Ajax request then supplies the component's true body. | |
A region of a page marked for dynamic updating via Ajax or other client-side effects. |
Bean Displaying & Editing
Main Article: BeanEditForm Guide
Displays the properties of a bean, using an underlying BeanModel, as a dl element with dt/dd pairs. | |
Creates an entire form for editing the properties of a particular bean | |
The central component of BeanEditForm, this generates a user interface for editing the properties of a bean | |
Outputs a single property value. Overrides for individual properties come from block parameters whose name matches the property id. This component is used by the BeanDisplay component. | |
Used to edit a single property of a bean. This is used primarily by BeanEditForm. |
Conditional and Looping Components
Conditionally renders its body. May render its tag and any informal parameters | |
Not really a component, but a technique to emulate a "case" statement using a delegate | |
Loops over a number of items (provided by its source parameter), rendering its body for each one] | |
Inverse of the If component, renders its body if the condition is false. | |
Does not do any rendering of its own, but will delegate to some other object that can do rendering |
Form Components
Renders a standard <input type="checkbox"> element | |
Renders a vertical list of <input type="checkbox"> elements | |
Collect a provided date from the user using a client-side JavaScript calendar | |
An HTML form, which will enclose other components to render out the various types of fields. | |
A portion of a Form that may be selectively displayed | |
Used to record a page property as a value into the form | |
Generates a label element for a particular field | |
Part of a Captcha based authentication scheme; a KaptchaField is paired with a KaptchaImage to ensure that the user has provided the correct value | |
Part of a Captcha based authentication scheme; a KaptchaImage generates a new text image whenever it renders and can provide the previously rendred text subsequently (it is stored persistently in the session) | |
A multiple selection component. Generates a UI consisting of two select elements configured for multiple selection; the one on the left is the list of "available" elements, the one on the right is "selected". | |
A version of TextField, but rendered out as an <input type="password"> element. | |
A radio button (i.e., <input type="radio">). Radio buttons must operate within a RadioContainer (normally, the RadioGroup component). | |
Groups together a set of radio components that all affect the same property | |
Renders a <select> element for selecting an item from a list of values | |
A non visual component used to provide notifications to its container during a form submission | |
Renders a <textarea> element for editing multi-line text | |
Renders an <input type="text"> element to edit single-line text | |
A file upload component (i.e., <input type="file">) based on Apache Commons FileUpload |
Grids, Tables and Trees
Presents tabular data in a <table> element by iterating over a List or array | |
Part of Grid, renders the markup inside a single data cell | |
Part of Grid, renders out the column headers for the grid, including links (where appropriate) to control column sorting | |
Generates a series of links used to jump to a particular page index within the overall data set | |
Renders out a series of rows within the table | |
A component used to render a recursive tree structure, with expandable/collapsable/selectable nodes. |
Links and Buttons
Triggers an action on the server with a subsequent full page refresh | |
Like ActionLink except that the event that it triggers is explicitly controlled, rather than always "action", and the event is triggered in its container | |
Generates a client-side hyperlink that submits the enclosing form | |
Corresponds to <input type="submit"> or <input type="image">, a client-side element that can force the enclosing form to submit | |
Generates a render request link to some other page in the application |
Output and Messages
Renders out an empty <div> element and provides JavaScript initialization to make the element the container for alerts. | |
Allows a component to render itself differently at different times, by making use of an external template file. | |
Presents validation errors of a single field. Must be enclosed by a Form component | |
Standard validation error presenter. Must be enclosed by a Form component. If errors are present, renders a div element around a banner message and around an unnumbered list of error messages | |
Integral part of the default ExceptionReport page used to break apart and display the properties of the exception | |
Renders an | |
A component for formatting output. If the component is represented in the template using an element, then the element (plus any informal parameters) will be output around the formatted value. | |
Output raw markup to the client. Unlike an expansion, the output from OutputRaw is unfiltered, with any special characters or entities left exactly as is. | |
Outputs paragraph oriented text, typically collected via a TextArea component. The TextArea is split into lines, and each line it output inside its own p element. |
Miscellaneous
Renders an arbitrary element including informal parameters | |
DevTool | Renders a dropdown menu of useful options when developing, such as reloading the current page or invalidating the current HttpSession. |
Overrides the DOCTYPE of the rendered document (via Document.dtd(String, String, String) which can be useful when different component templates that render to the same document disagree about what the correct DOCTYPE is. | |
Renders out an object using the ObjectRenderer service. Used primarily on the ExceptionReport page | |
Triggers an arbitrary event during rendering. This is often useful to add JavaScript to a page or a component (via calls to the JavaScriptSupport environmental). |
Tapestry Mixins
Main Article: Component Mixins
Mixins allow you to add behaviors to existing components. The core mixins are found in the org.apache.tapestry5.corelib.mixins package.
Tapestry includes the following mixins out-of-the-box.
modifies a text field to provide for auto-completion of text using values retrieved from the server as the user types. See instructions. | |
Confirm | attached to a Form or link component, runs a modal-dialog to force the user to confirm the behavior. New for Tapestry 5.4. |
discards a component's body. Returns false from the BeforeRenderBody phase, which prevents the rendering of the body. | |
instruments the outer Form on which component the focus should be activated. Replaced by OverrideFieldFocus starting in Tapestry 5.4. | |
FormGroup | attaches to a field to render an enclosing <div> element and label for proper Bootstrap markup of text fields, selects, and textareas |
attaches to any component that renders an element. At the end of the render, if the element is empty, then a non-breaking space ( ) is injected into the element. | |
when attached to a form field, causes that field to gain focus. Starting in Tapestry 5.4, this supersedes FormFieldFocus. | |
forces a client element to render its client id by ensuring that "getClientId" is called. | |
renders a "disabled" attribute if the containing component is disabled | |
renders out all informal parameters, at the end of the BeginRender phase. This mixin can be used with components that render a single tag inside the BeginRender phase. | |
triggers component event notifications when the attached component enters its BeginRender and AfterRender render phases. | |
when applied to a Checkbox or Radio component, links the input field and a FormFragment, making the field control the client-side visibility of the FormFragment | |
periodically refreshes a Zone by triggering an event on the server using ajax requests. |
Tapestry Pages
Tapestry provides several special pages that provide status information. Most of these are found in the org.apache.tapestry5.corelib.pages package.
Responsible for reporting runtime exceptions. This page is quite verbose and is usually overridden in a production application. | |
Lists out the currently loaded pages, with some statistics. | |
Contains blocks for displaying basic property types; the blocks are contributed to the BeanBlockSource service. | |
A page that exists to contain blocks used to edit different types of properties. The blocks on this page are contributed into the BeanBlockSource service configuration. | |
A page used to see the status of all services defined by the Registry. |
Base Components
The base components, in the org.apache.tapestry5.corelib.base package, are intended to be extended by other components rather than used directly in templates.
Base class for link-generating components that are based on a component event request. Such events have an event context and may also update a Zone. | |
Base class for If and Unless. Will render its body or the block from its else parameter. If it renders anything and it has an element name, then it renders the element and its informal parameters. | |
Provides initialization of the clientId and elementName properties. In addition, adds the RenderInformals, RenderDisabled and DiscardBody mixins. | |
Provides base utilities for classes that generate clickable links. | |
Base class for components that output a property value using a PropertyModel | |
Abstract class for a variety of components that render some variation of a text field. Most of the hooks for user input validation are in this class | |
Base class for components that output messages |
Other Component Libraries
See Modules