using an LDM is best practice, big or small...
-igor
On Thu, Oct 2, 2008 at 11:09 AM, Jürgen Lind <[EMAIL PROTECTED]> wrote:
> I see. So for a small application with few users, the approach might be
> ok if I can live with a higher memory consumption. For larger
> applications, using a loadable d
I see. So for a small application with few users, the approach might be
ok if I can live with a higher memory consumption. For larger
applications, using a loadable detachable model would be preferable.
Thank you for the clarification.
J.
Igor Vaynberg wrote:
yes, there is a huge fundamental
yes, there is a huge fundamental problem with your approach: you keep
the object reference which means the object is serialized instead of
being retrieved through a loadable detachable model.
-igor
On Thu, Oct 2, 2008 at 10:54 AM, Jürgen Lind <[EMAIL PROTECTED]> wrote:
>
> Thanks for the explanat
Thanks for the explanation. Still, one questions remains: is there
a fundamental problem with the first approach or is it ok to use
the object directly?
J.
Igor Vaynberg wrote:
final TestItem itemModel = (TestItem) item.getModelObject();
^ on this line you retrieve the object from the model,
final TestItem itemModel = (TestItem) item.getModelObject();
^ on this line you retrieve the object from the model, you then use
this reference inside the onclick() which is called during another
request. since you use the model object reference directly it is not
loaded from the model.
my code,
Igor Vaynberg wrote:
your link works on the object and not on the model, instead
add(new link("delete", item.getmodel()) { onclick() {
delete(getmodelobject()); }});
Thank you for your quick reply.
Well the code is roughly the same(?) as in Listing 5.12 of WiA and there
a custom Model is use
your link works on the object and not on the model, instead
add(new link("delete", item.getmodel()) { onclick() {
delete(getmodelobject()); }});
-igor
On Thu, Oct 2, 2008 at 9:04 AM, Jürgen Lind <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> I have been struggling for some time now to understand how
Hi there,
I have been struggling for some time now to understand how
LoadableDetachableModel and a ListView work together. The starting point
was Chapter 5.5.2 of "Wicket in Action" where it is recommended to provide
your own ItemModel if the underlying list changes frequently. To try out
how Wic