Re: NPE in Component.detachModel() when wrappedModel is null

2007-07-09 Thread Igor Vaynberg
On 7/9/07, Jan Vermeulen <[EMAIL PROTECTED]> wrote: That's the whole point: in the wrapModel, I store a key with which I can retrieve the wrappedModel from a context. So the wrapModel only stores a 'transient' reference to the wrappedModel, and its detach() clears that reference. Whenever aske

Re: NPE in Component.detachModel() when wrappedModel is null

2007-07-09 Thread Jan Vermeulen
Johan Compagner wrote: > > I still can't see the complete picture here how you are avoiding that > those > data structures are not serialized with just using IComponentAssignedModel > because that model is referenced by the component. And that model has to > reference the real model because how

Re: NPE in Component.detachModel() when wrappedModel is null

2007-07-09 Thread Johan Compagner
What we are looking for is some transparent way for users to provide data to components that do not get stored with these components when the page is serialized. your are just describing IModel.detach().. But i guess your model that is wrapped does this behavior in detach? then how is this mo

Re: NPE in Component.detachModel() when wrappedModel is null

2007-07-09 Thread Jan Vermeulen
Conclusion: wrapOnAssignment is not the right way to obtain the behavior we want. What we are looking for is some transparent way for users to provide data to components that do not get stored with these components when the page is serialized. By making these 'context-stored' data-structures impl

Re: NPE in Component.detachModel() when wrappedModel is null

2007-07-09 Thread Johan Compagner
I think it is wrong that the getWrappedModel() returns null it is pretty much the contract that it has to return the model that it wraps around it is used in more places. (set model, inner model or getInnerMostModel) and no if the model is not a inherited model but a component assign aware model

NPE in Component.detachModel() when wrappedModel is null

2007-07-09 Thread Jan Vermeulen
Following code provokes a NPE the wrappedModel is null: // also detach the wrapped model of a component assignet wrap (not inherited) if (model instanceof IWrapModel && !getFlag(FLAG_INHERITABLE_MODEL)) { ((IWrapModel)model).getWrappedModel().detach();