On Mon, 07 Mar 2011 12:10:55 -0300, robnangle <robnan...@gmail.com> wrote:
So what your saying is to use the id to select the correct person from
the database?
Yes.
Ant then in the other class, how do I use the encoder?
@Property
private PlayerEncoder encoder;
void onPrepare() {
encoder = new PlayerEncoder();
}
Pass your encoder to the encoder parameter of Grid.
You can automatically associate your PlayerEncoder with the Player class
in your AppModule so every time a ValueEncoder is needed for Player
instances it's needed (including the Select component):
public static void contributeValueEncoderSource(MappedConfiguration<Class,
ValueEncoderFactory> configuration) {
configuration.addInstance(Player.class, PlayerEncoderFactory.class);
}
You'll need to make your ValueEncoder also implement ValueEncoderFactory
and add this method:
public ValueEncoder create(Class type) {
return this;
}
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org