I'm helping a client build a CRUD app on top of tapestry-hibernate
His pattern is to use the same exact page for edit and create pages
The problem he's getting is this:
@PageActivationContext
private MyEntity myEntity;
void onActivate() { if (myEntity == null) { myEntity = new MyEntity(); } }
This works fine for editing of existing entities, but the creation
fails ... tapestry-hibernate's ValueEncoder attempts to encode the
transient instance and gets a failure because there's no persistent id
until it is made persistent.
I'd like to change the support to handle this case by returning a null
or empty page activation context when the object to be encoded is null
or transient.
This is a quasi-backwards-compatible change ... it will enable a
behavior that, in prior releases, would be a runtime exception.
Thoughts?
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]