On Tue, 09 Sep 2014 04:10:22 -0300, Boris Horvat
<horvat.z.bo...@gmail.com> wrote:
Hi my methods look like this
public boolean onActivate(Scene scene) {
selectedScene =
scene;//systemManager.getScene(Long.parseLong(scene.toString()));
return selectedScene != null;
}
public Scene onPassivate() {
return selectedScene;
}
I don't have ValueEncoder cause I would expect that conversion works
String
-> Long -> hibernate gets the id of the object and returns -> MyObject
(i.e. Scene in this case).
I don't think your assumption is correct. For onActivate(Scene) to work,
you need a ValueEncoder for Scene or at least String to Scene coercion.
Same for onActivate(). As Lance said, if you're using tapestry-hibernate
and Scene is a Hibernate entity, Scene already has a ValueEncoder
automatically contributed.
As Lance said, you should never return boolean in onActivate(). It's not a
component render phase event handler.
I can add one but I would not expect that I needed it, especially since
when I first navigate to the page it works without a problem, but when I
submit a form it breaks
org.apache.tapestry5.ioc.util.UnknownValueException
Could not find a coercion from type java.lang.String to type
domain.Scene.
This matches what I said above.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org