wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Igor Vaynberg <igor.vaynb...@gmail.com>
Subject Re: Behaviour.onInitialise()
Date Thu, 07 Feb 2013 08:13:36 GMT
What happens if the behavior is added after the component has already been
initialized? Does its oninitialize() still get called? Ambiguities like
this is the reason why there is no such method.

-igor

On Wednesday, February 6, 2013, Colin Rogers wrote:

> Martin and other Wicketeers,
>
> I have a quick, small question; why is there no 'onInitiailise()' method
> on Behaviour classes?
>
> There is an 'bind' method, but this, unlike 'onInitialise' is call
> immediately on binding to component, whether the component is in the
> component tree or not. Obviously it's very easy to work around;
>
> *         Simply ensure that bind is called after the component is added
> to the component tree, even throwing an exception when 'component'
> parameter has null for a parent. (This is how AbstractAjaxBehavior works).
>
> *         Add a 'firstTime' flag in onConfigure, and set to false after
> the onInitialise functionality is performed.
>
> While it is easy to work around, it seems odd that Behaviours lack the
> common onInitialise that all Wicket components otherwise have, I'm curious
> as to why that is, and hoping it wouldn't be an issue to add - it would aid
> in removing boiler plate code in Behaviours.
>
> Cheers,
> Col.
>
> PS. Apologies for spelling 'initialise' and 'behaviour' correctly - I
> can't help it... :)
>
> EMAIL DISCLAIMER This email message and its attachments are confidential
> and may also contain copyright or privileged material. If you are not the
> intended recipient, you may not forward the email or disclose or use the
> information contained in it. If you have received this email message in
> error, please advise the sender immediately by replying to this email and
> delete the message and any associated attachments. Any views, opinions,
> conclusions, advice or statements expressed in this email message are those
> of the individual sender and should not be relied upon as the considered
> view, opinion, conclusions, advice or statement of this company except
> where the sender expressly, and with authority, states them to be the
> considered view, opinion, conclusions, advice or statement of this company.
> Every care is taken but we recommend that you scan any attachments for
> viruses.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message