My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
Util  

Featured
Updated Nov 30, 2009 by gagari...@gmail.com

This will propably be the largest of modules. General purpose utilities will live here.

@InjectSelectModel

Binding this annotation extends component with additional properties that represent SelectModel based on values in list it is bound to. The code is mostly based on approach described in Tapestry 5 HowTos.

Bind annotation to a property:

public class Countries {

    @InjectSelectionModel(id = "countryId", label = "name")
    private List<Country> countries;

}

Annotation property Meaning
idProperty representing <option> element's value.
labelProperty which defines list value distinctly.
labelFormatLabel string format. Property placeholders must be enclosed withing curly brackets (e.g. "[{code}] {name}").

Set model and encoder attributes to (field)SelectModel and (field)ValueEncoder respectively in <select> element:

<select t:type t:id="country" model="countriesSelectModel" encoder="countriesValueEncoder"/>

Sign in to add a comment
Powered by Google Project Hosting