Re: Problem understanding LoadableDetachableModel and ListViews

2008-10-02 Thread Igor Vaynberg
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

Re: Problem understanding LoadableDetachableModel and ListViews

2008-10-02 Thread Jürgen Lind
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

Re: Problem understanding LoadableDetachableModel and ListViews

2008-10-02 Thread Igor Vaynberg
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

Re: Problem understanding LoadableDetachableModel and ListViews

2008-10-02 Thread Jürgen Lind
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,

Re: Problem understanding LoadableDetachableModel and ListViews

2008-10-02 Thread Igor Vaynberg
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,

Re: Problem understanding LoadableDetachableModel and ListViews

2008-10-02 Thread Jürgen Lind
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

Re: Problem understanding LoadableDetachableModel and ListViews

2008-10-02 Thread Igor Vaynberg
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

Problem understanding LoadableDetachableModel and ListViews

2008-10-02 Thread Jürgen Lind
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