How would you notice if the user leaves the page? If you have only Wicket controlled Links on your page then you could null your "Repository" data in their onclick() implementation (if you do a setResponsePage(someOtherPage). If there's also non-Wicket links on your page, well, you would probably have to use some JS magic (+ AJAX) to react upon page leave event. I don't like either of those solutions but would prefer a cache including expiry strategy instead. About how much data are we talking here? Isn't it possible to do some kind of paging or do you need to fetch the whole dataset?
-Tom On 14.06.2012 at 16:57 brazz wrote: > Hi, > > i have a list view with content from a "Repository" that is input to a > wicket DataProvider with ModelObject. > I get the content of the repository from a webservice. > I don't want to load the data from the webservice after each request, but > the model gets detached after each request and accordingly my Repository > (which is connected to the webservice) is empty after each request (because > its objects are set to null in the detachment process). > > Now, is there a way to influence a LoadableDetachableModel in a way that it > gets detached after the user leaves the page/accesses another page. I tried > to overwrite the detach-method but without success. > > As a workaround i'm using the session to store my repository but then i > don't have an indication when the data isn't needed any more. I think about > time based expiration of session data (time based cache mechanism like in > guava library), but i think this is rather cumbersome. Detaching the model > object after the user leaves the page would be more elegant. > > Thanks for any suggestions or hints how you fixed this scenario. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
