Tapestry -Deli
A collection of fun Tapestry tools
[Workbench] [Collect Pages] [Base components] [Checkboxes] [Useful classes] [Listeners]

Eclipse Plugins

The Spindle and Palette plugins for Eclipse greatly simplify Tapestry development. Spindle allows you to easily create and modify Tapestry applications, and validates your work in real time. Palette extends Spindle by allowing you to easily integrate Tapestry component libraries, such as the ones presented on this site. Please see the Palette video for a demonstration.

Tapestry Workbench

Version: 3.0

The Tapestry Workbench application is a part of the Tapestry distribution. It demonstrates some of the main features and components in Tapestry, including:

  • Forms and field components, including automatic client-side value validation using JavaScript
  • Date fields and the DatePicker component
  • Custom services that generate non-HTML content
  • File uploads
  • Localization
  • JSP and servlet integration
  • Exception reporting and "line precise" error handling in particular
  • Several other cool components such as Palette and Table.

[Tapestry Workbench]

Collect pages using Ant

Version: 1.1

An Ant task that automatically updates your .application or .library files with the pages and components defined under a particular location. It allows you to create your pages in a folder hierarchy rather than in a single directory, and have them automatically declared in the Tapestry configuration files as part of the build process.

Example:

  <taskdef name="collectpages" 
   classpath="${lib}/collectpages.jar"
   classname="org.mb.collectpages.Task"/>

  <target name="collect">
      <collectpages 
       application="src/org/mb/app.application" 
       updateExisting="yes" removeMissing="no">
          <fileset dir="src"/> 
      </collectpages>
  </target>

[collectpages task for Ant] [collectpages source]

Useful Classes

Version: 1.1

This JAR does not contain any components, but only plain classes and as such can simply be placed on the classpath to be used by the application. It provides several useful classes, among which:

  • The FormLinkRenderer class that allows the links in your application to contain parameters that are not limited by the maximum URL size. Simply add the following renderer parameter to any of your DirectLink, ExternalLink, or other link components, and the links they generate will automatically become POST requests with no size limit:
    <span jwcid="@DirectLink" 
     renderer="ognl:@org.mb.tapestry.link.FormLinkRenderer@RENDERER"
     ...
    
  • The Splitter class that allows you to break an array of objects into a matrix with a given number of rows or columns. It is useful when a collection of items need to be presented in a matrix-like view.

[Useful Classes library] [Useful Classes source]

Make dynamic apps with XMLHttpRequest

Version: 0.6

The XTile library contains the XTile and Timeout components.

XTile allows you to easily integrate XMLHttpRequest (Ajax) functionality into your application with very little JavaScript knowledge, as it operates similar to a DirectLink. When the component is included into a page, the call of a specified JavaScript function causes a connection to the server and the invocation of selected listener method in your Java code. The values you have passed to the JavaScript function will be passed to the listener method as well. Similarly, when the listener returns, another JavaScript function will be invoked and the listener can pass values to it as well. The provided example shows how easy it is to implement complex Ajax applications with XTile.

Timeout is built using XTile and avoids expiration of the server session against the user's intent. If the component detects user activity in the browser a certain amount of time after the page has been loaded, it silently connects to the server and prolongs the session. If the session is about to expire since there is no user activity, a warning message is displayed that allows the user to explicitly prolong the session if he so desires.
Timeout is extremely useful when the user fills in long forms or edits large content. It helps avert a lot of user complaints.
The component is completely configurable and the unwanted functionality can be disabled -- see the reference for details.

[XTile library] [XTile source] [Example] [Component Reference]
[XTile for Tapestry 4 (by Paul Green)]

Alternative base components

Version: 1.1

The If, Else, and For components provided by the Base library are similar to the Conditional and Foreach components that are a part of the Tapestry core distribution, but provide the following additional features:

  • If the components are located in a Form, they automatically generate Hidden fields and ensure that the form will rewind as it was rendered and no stale link exceptions will occur.
    The components can be viewed as a combination of the general Tapestry components (e.g. Conditional, Foreach) and their form-specific versions (e.g. FormConditional, ListEdit).
  • The Else component does not take a condition, but can be used in conjunction with the If component (see example)
  • The For component provides a simple mechanism for converting values to and from their primary keys that will be stored in the form.

[Base library] [Base source] [Example] [Component Reference]

Checkbox Groups

Version: 1.1

The Checkboxes library allows you to easily create a group of checkboxes so that clicking on a special "controller" checkbox will select all within the group.

This feature is often useful when you are displaying a set of items, for example the mail messages in a web-based email client, and would like to have an easy way to select or deselect all of them.

The library defines three components: CheckboxGroup, ControlledCheckbox, and ControlCheckbox. Selecting or deselecting a ControlCheckbox checks or unchecks all ControlledCheckboxes within the same CheckboxGroup.

[Checkboxes library] [Checkboxes source] [Example] [Component Reference]

 
Other fun tools

Listeners

Version: 1.0

The Listeners library allows you to geatly simplify the code you add to support listeners in your code.

It contains listener collections that provide special proxy object. Invoking a method on the proxy automatically invokes the method on all contained listeners. As a result, there is no longer need to implement 'fire' methods, your code is simplified, and its correctness is guaranteed.

[Examples, performance, and download]

mindbridgeweb@yahoo.com