Sven,

I've been using wicket for over a year, so I'm quite familiar with Model usage. So thanks for the explanation, but I'm already using CompoundPropertyModels and PropertyModels everywhere. Because of this it's all the more frustrating to see model contents in my session.

Bas

----- Original Message ----- From: "Sven Meier" <[email protected]>
To: <[email protected]>
Sent: Wednesday, August 26, 2009 9:48 PM
Subject: Re: How to detect model "leakage" into session


Hi,

you're probably doing something like the following:

 add(new Label("foo", ldm.getObject().getFoo()));

Never do that, instead use:

 add(new Label("foo", new PropertyModel(ldm, "foo")));

... or ...

 add(new Label("foo", new AbstractReadonlyModel() {
   public Object getObject() {
     return ldm.getObject().getFoo());
   }
 }));

... or even better ...

 setModel(new CompoundPropertyModel(ldm));

 add(new Label("foo")); // -> getFoo()
 add(new Label("bar")); // -> getBar()
 add(new Label("baz")); // -> getBaz()

HTH

Sven

On Mi, 2009-08-26 at 21:29 +0200, Bas Gooren wrote:
Hi all,

My problem is as follows: I use LoadableDetachableModels throughout my application, and have made sure I never use a model without it being attached to a component to prevent models which never get their detach() method called. Nonetheless, after hitting two fairly simple pages which list some database data in my application, I get a 100kb session which is filled with literal strings from model objects.

I've fired up my (Eclipse) debugger and have stepped through all models on one of the pages after setting a breakpoint on the pages onDetach() method. I see all LoadableDetachableModels are detached, so I have no idea what's causing this.

What would be a good strategy for finding the source of this problem?

Bas


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




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

Reply via email to