Hi,

I have some experience in JSF and basically even now when I'm trying to
create some application in Tapestry sometimes I'm trying to find similar
solutions/approaches which I used in JSF. Anyway JSF provided such a good
thing like Converters. For example on your form you had text field to input
user id and in your POJO during handling submit event you need to load
hibernate object using userId parameter. Of course, one of the way to do it
is to create String property to userId and then in onSubmit try to load
using Hibernate User object by userId parameter. But in JSF I can create
Converter with two methods:

      getAsString(.....) // this method will convert User object to userId
string
      getAsObject(.....) // this method should convert userId parameter into
hibernate User entity

After that I need to register this converter and attach it to my text field
component. Also in my POJO I need to change property type from String to
User. This approach provides a lot of benefits and make possible to reuse it
on many pages where user can input 'userId' and we need to load Hibernate
entity User. This converter will be run automatically by JSF.

Does Tapestry 5 have something like converters?

Reply via email to