Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.
argoyle edited this page Feb 11, 2012 · 8 revisions

Tapestry-tagselect is a select component for Tapestry 5 with modes similar to the version selector in recent JIRA-versions as well as the language selector on Facebook.

Basic usage

Add a dependency to your POM (for Tapestry 5.2.6 use version 1.4 instead of 1.4.1 which is for Tapestry 5.3.2):

<dependency>
  <groupId>se.unbound</groupId>
  <artifactId>tapestry-tagselect</artifactId>
  <version>1.4.1</version>
</dependency>

Add the component to your template:

<div t:type="tag/tagselect" t:id="tags" t:value="tags" t:encoder="encoder" />

In your page you need a property for the currently selected tags. If the property is a Collection the component allows multi-select, otherwise it's single-select.

If the tags are strings, no encoder is necessary, otherwise a LabelAwareValueEncoder need to be provided via the encoder-attribute. The LabelAwareValueEncoder is a special extension of the standard Tapestry ValueEncoder with the small addition of being able to get a label for the value.

The component uses an Ajax.Autocompleter when retrieving the possible tag-values so a method for the provideCompletions-event that return a SelectModel is necessary in the page-class as well.

You can choose to not show the dropdown-arrow (using t:dropdown="false" in the template) as well as having each tag be presented as a separate input-field similar to the Facebook language-selection using t:vertical="true" in the template.

Screenshots

Version 1.4

Examples

Multi-select string-tag

Single-select string-tag

Clone this wiki locally