I'm having difficulty in seeing the best-practice way of handling DDCs
who's choices are hibernate persisted entities.
Obviously the selection in this case would be a reference to a persisted
entity, which is inherently bad, as this would put the entity into the
session and also result in a "stale" entity reference on the next
request (assuming you are using OSIV filter).
I'm aware that on form submit, the HTML selection results in a "fresh"
object being pulled from the DDC choice list and set as the selection.
As long as the choices are loaded dynamically, this works (although the
selected entity will end up in the session).
However, I am using a wizard in the app that I am working on and want to
pre-select a choice from a list of persisted entities. This DDC is used
in step 3, which gives a hibernate "no session" exception when when the
step is reached. This is understandable, as wicket's rendering needs
will cause an attempted initialization of the proxy, which is attached
to an old session.
The obvious solution is for the selection to be the entity's id.
What is the best way of handling this situation?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org