well, unfortunately it is now a requirement due to various reasons.

what you should do is factor out whatever behavior out of onattach() into a
separate method, and then override that method in the subclass, that way you
dont need to override onattach() in the subclass, and even if you do you can
still call super.

-igor


On 1/3/07, Jan Vermeulen <[EMAIL PROTECTED]> wrote:


The problem is I don't want to call super.onAttach(), because the code of
my
onAttach() overwrites the behavior of the code in super.onAttach().
But if I don't call super.onAttach(), the flag FLAG_ATTACHING never gets
reset, and Wicket throws an exception.

Jan.


igor.vaynberg wrote:
>
> what exactly is the problem?
>
> can you not do
>
> onattach() {
>   super.onattach();
>   togglevisibilityofchildren();
> }
>
> and no you cannot use attachchildren(), it is package-private
>
> -igor
>
>
> On 1/3/07, Jan Vermeulen <[EMAIL PROTECTED]> wrote:
>>
>>
>> The last change in TRUNK related to onAttach(), with the introduction
of
>> a
>> (private) flag FLAG_ATTACHING that is reset in the onAttach() of
>> Component,
>> is causing us problems. We have inherited components that override the
>> logic
>> of the onAttach() of their superclass, typically enabling/disabling or
>> hiding of child components in function of some dynamically changeable
>> state.
>> With the introduction of the flag, we are bound to call the
>> implementation
>> of the superclass, in order to reset the flag correctly.
>>
>> Are we using onAttach() in a wrong way ? I understood it is a callback
>> method that allows component implementors to do their thing, without
>> having
>> to worry about the internal attach logic. Or should we use
>> attachChildren()
>> for that ?
>>
>> Jan.
>> --
>> View this message in context:
>>
http://www.nabble.com/onAttach%28%29-and-FLAG_ATTACHING-tf2913350.html#a8140407
>> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/onAttach%28%29-and-FLAG_ATTACHING-tf2913350.html#a8145567
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Reply via email to