Re: model detached many times

2009-07-13 Thread Vladimir K
://www.nabble.com/model-detached-many-times-tp24422368p24457432.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail

Re: model detached many times

2009-07-13 Thread James Carman
/wicket/1.3. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- View this message in context: http://www.nabble.com/model-detached-many-times

Re: model detached many times

2009-07-13 Thread Erik van Oosten
As models are nested this is not possible with the current setup. If a model nests another model, the nesting model is responsible for calling detach on the nested model. Multiple models may nest the same model. So the best thing to do for now is to have some flag to see if you're already

Re: model detached many times

2009-07-13 Thread James Carman
On Mon, Jul 13, 2009 at 7:32 AM, Erik van Oostene.vanoos...@grons.nl wrote: So the best thing to do for now is to have some flag to see if you're already detached. In getObject the flag is cleared. For most models however, it should not matter if they're called multiple times; the typical thing

Re: model detached many times

2009-07-13 Thread Ian MacLarty
On Mon, Jul 13, 2009 at 9:43 PM, James Carmanjcar...@carmanconsulting.com wrote: On Mon, Jul 13, 2009 at 7:32 AM, Erik van Oostene.vanoos...@grons.nl wrote: So the best thing to do for now is to have some flag to see if you're already detached. In getObject the flag is cleared. For most models

Re: model detached many times

2009-07-12 Thread Ian MacLarty
On Fri, Jul 10, 2009 at 6:00 PM, Martijn Dashorstmartijn.dasho...@gmail.com wrote: If you share a model between components, then yes–each component will call detach on the model. That's encapsulation for you: one component doesn't know about another component, so it can't know that its model

model detached many times

2009-07-10 Thread Ian MacLarty
Hi, I noticed that my IDetachable model is being detached many times (hundreds) for each request. Is that something to worry about, or is it just because the detach method is called for each component that points to this model? Ian.

Re: model detached many times

2009-07-10 Thread Eelco Hillenius
It's fine if a model if detached multiple times in a request, but hundreds for a single model sounds suspicious. Try to trace what components fire the detach method and see if there's anything weird with that. Eelco On Thu, Jul 9, 2009 at 11:21 PM, Ian MacLartyian.macla...@gmail.com wrote: Hi,

Re: model detached many times

2009-07-10 Thread Ian MacLarty
I put a breakpoint on the detach method of my model and had a look at the Components whose detach methods were called higher up in the stack trace. It looks like the detach method on the model is being called for every component on the page. All the components link to the same underlying model

Re: model detached many times

2009-07-10 Thread Martijn Dashorst
If you share a model between components, then yes–each component will call detach on the model. That's encapsulation for you: one component doesn't know about another component, so it can't know that its model was detached. Martijn On Fri, Jul 10, 2009 at 9:41 AM, Ian

Re: model detached many times

2009-07-10 Thread Martijn Dashorst
Automatic detachment is one of the things we're looking into for 1.5 or 1.6 Martijn On Fri, Jul 10, 2009 at 12:47 PM, James Carmanjcar...@carmanconsulting.com wrote: Perhaps there could be some sort of registry for models that need to be detached.  Then, after rendering, they're all detached

Re: model detached many times

2009-07-10 Thread James Carman
Right, but they shouldn't have to be detached multiple times. My point is that we should collect all the models that need detaching and call detach on them only once. Automatically deciding which ones need to be detached is a separate issue. On Fri, Jul 10, 2009 at 7:18 AM, Martijn