Hi!
2011/2/25 Brown, Berlin [GCG-PFS] <[email protected]>
> I was trying to get a feel for the wicket lifecycle, I can where
> onBeforeRender, onAfterRender are called during the component rendering
> lifecycle. But, I still don't see when the constructor (object
> instantiation) of a component. If I debug and/or trace the constructor
> calls, it looks like the component is instantiated every time is
> rendered?
>
not. comopnent is instantiated once.
>
> With ajax components, when is the constructor of a component called?
When your code creates them. It can be in other component's constructor or
in a event handler method.
> In my case below, when is the MyPanel constructor called. Only once? when
> the object is added to the ajax tabbed panel. Or when the content is
> rerendered?
>
> AjaxTabbedPanel ajaxTabbedPanel
> ...
>
> public class MyPanel extends Panel {
>
> public MyPanel() {
> ... add components.
> }
>
> }
>
> ....
> new Page();
> ajaxTabbedPanel.addTheMyPanelToAjaxPanel(new MyPanel));
> thePage.add(ajaxTabbedPanel)
> ...
>
> onClickOfTab {
> target.addComponent(myPanel)
> }
>
at "new MyPanel" but your code has syntax errors and can't be compiled.
berkes