Em Mon, 16 Feb 2009 22:25:14 -0300, Luther Baker <lutherba...@gmail.com>
escreveu:
I want to pass something like this into a BeanEditForm and have the it
invoke school.toString() or possibly, school.getName().
Is not that simple. Besides the label, you need to map from object to
value (option HTML tag) and value to object. That's exactly what the
ValueEncoder does.
I've looked at
http://wiki.apache.org/tapestry/Tapestry5HowToCreateAPropertyEditBlock
but found it a bit confusing. At some high level, is there a brief
synopsis of the different players required to do this?
PropertyEditor
ValueEncoder
DataTypeAnalyzer
PropertyEditContext
@Environmental
the Model ... etc.
Take a look at their Javadocs and the BeanEditForm tutorial:
http://tapestry.apache.org/tapestry5/guide/beaneditform.html.
Now, on the other hand, is the BeanEditForm really considered just a
starter component and is generally not used for production code?
I haven't used it in production yet, but I'll do it soon.
In which case, is it just fine to come up with custom solutions to
determine types and how to render them? Or is there a strong reason to
go through all of this ... when I want to render a nested Hibernate
Entity with a toString().
It depends on how many times, in different places of your application,
you'll need to edit a collection of a given class. If it's just one, use a
t:parameter block. Otherwise, do the right thing: reuse code. ;)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org