Hi,

Most wicket components use models and providers mainly so you can decide if the data should be serialized or not. You can control what kind of models are used, and how much data they serialize.

If you use proper loadable & detachable models, then wicket will not serialize your Contact instances.

What happens is this: wicket renders your datatable, and if it (or something else on the page) contains stateful components, serializes the page.

Now two things can happen (amongst others, and not mutually exclusive):
A - a stateful component is invoked, e.g. the user clicks a link inside your datatable. Wicket now looks up the specific link inside your datatable (as it was last rendered), and load()s your model, and thus the Contact it points to. B - the page is re-rendered. Wicket basically removes all rows inside your datatable, and re-renders its based on your provider.

A datatable is basically a fancy RefreshingView with some additional components, and as the name of that class points out: the contents are refreshed on each render.

I haven't taken an in-depth look myself yet, but I'm sure this is explained in the excellent free wicket guide recently created by another wicket user: http://wicket.apache.org/learn/books/freeguide.html

Met vriendelijke groet,
Kind regards,

Bas Gooren

Op 21-6-2013 18:48, schreef Baptiste75:
A thousand thanks, Sebastian!
Your sample did it!

Juste a last question, out of curiosity (if you have a clue):
Did this exception occur because DataTable, after retrieving the user
objects from the provider,  *stores* them somewhere in an inner component?
And so when the Page is serialized, the DataTable is too, and my objects
Contact as well?
Because then I am wondering the point for a DataTable to memorize the user
data... I would expect it to iterate on them, display, and then get rid of
them, transiently...



--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/DataTable-and-unserializable-data-tp4659659p4659678.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to