Hi,
I've got the above problem which I have boiled down to the following basic
example.....
MyPage references PanelA and PanelB which it swaps about depending on the
current state - both are created when the page is created but PanelA is
added to MyPage as the default display panel.
PanelB contains the following label...
add(new Label("testLabel", new PropertyModel(myLDM, "someCollection")));
myLDM is a LoadableDetachableModel which wraps a hibernate entity which, in
turn, has a 'someCollection' property.
On loading MyPage (first request), everything is fine (MyPage creates PanelA
and PanelB and displays PanelA). However on moving to PanelB (second
request) I get a LazyInitializationException saying that someCollection
couldn't be loaded.
I've already found a fix to this problem.... I delay the creation of the
panels until they are actually being used (i.e. on the call to
Panel.replaceWith()). However, I just can't really get my head around why
this fails in the first place. Basically why is the LDM not calling load()
on the second request?
Also, as the late-construction of the panels seems to work... is this what
people would recommend when swapping panels in and out of a page?
Any help much appreciated,
Neil.
--
View this message in context:
http://www.nabble.com/LazyInit-error-with-LDM-in-a-panel-tp20228580p20228580.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]