Very cool.  Thanks, Wicket Team!

On Mon, Jul 12, 2010 at 10:09 PM, Igor Vaynberg <igor.vaynb...@gmail.com> wrote:
> there have been a lot of threads over the years about having some
> place to initialize components other than constructors. there are a
> few problems with constructors, such as not being able to call
> getPage() or non-final methods. historically we have refused to
> implement this because we have maintained constructors were good
> enough, but over the years i have seen a few usecases where something
> like this would have been really nice. there have always been easy
> workarounds that is why we were in no hurry to implement this, but i
> think the time has come.
>
> below is the javadoc from the method
>
>        /**
>         * This method is meant to be used as an alternative to initialize
> components. Usually the
>         * component's constructor is used for this task, but sometimes a
> component cannot be
>         * initialized in isolation, it may need to access its parent
> component or its markup in order
>         * to fully initialize. This method is invoked once per component's
> lifecycle when a path exists
>         * from this component to the {...@link Page} thus providing the
> component with an atomic callback
>         * when the component's environment is built out.
>         * <p>
>         * Overrides must call supe...@link #onInitialize()}
>         * </p>
>         *
>         * <p>
>         * It is safe to use {...@link #getPage()} in this method
>         * </p>
>         *
>         * <p>
>         * NOTE:The timing of this call is not precise, the contract is that
> it is called sometime
>         * before {...@link Component#onBeforeRender()}.
>         * </p>
>         *
>         */
>        protected void onInitialize()
>        {
>        }
>
> play around and see if you can find any problems. this will be part of
> 1.4.10 and 1.5.M1
>
> -igor
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to