You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by dukehoops <ni...@doppelganger.com> on 2008/11/23 23:06:29 UTC

isVisibilityAllowed() not consulted before calling onBeforeRender()?

I have a component whose parent does this:

class Parent extends Panel

private Component child;

onBeforeRender()
{
child.setVisibilityAllowed(false);
super.onBeforeRender();
}

I would expect child's onBeforeRender() to not be executed but it is,
because Component.internalBeforeRender calls isVisible() rather than
determineVisibility().

Is that by design? If so, why?

If this is a bug, should the following line in
Component.internalBeforeRender():

		if ((isVisible() || callOnBeforeRenderIfNotVisible()) &&
!getFlag(FLAG_RENDERING) &&
			!getFlag(FLAG_PREPARED_FOR_RENDER))

be this:

		if ((determineVisibility() || callOnBeforeRenderIfNotVisible()) &&
!getFlag(FLAG_RENDERING) &&
			!getFlag(FLAG_PREPARED_FOR_RENDER))

thanks
-nikita




-----
----------------
Nikita Tovstoles
vside.com
----------------

-- 
View this message in context: http://www.nabble.com/isVisibilityAllowed%28%29-not-consulted-before-calling-onBeforeRender%28%29--tp20651326p20651326.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


quit email list

Posted by fish3934 <fi...@163.com>.
Dear All,
    I would like to quit this email list temporarily. I try to send email to
users-unsubscribe@wicket.apache.org , but failed. Can anyone tell me how I
can quit email list?

Best regards,



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


Re: isVisibilityAllowed() not consulted before calling onBeforeRender()?

Posted by dukehoops <ni...@doppelganger.com>.
JIRA filed: https://issues.apache.org/jira/browse/WICKET-1954

Apologies, but I am not setup to create a quick-start. Hopefully,
description is precise enough.

-----
----------------
Nikita Tovstoles
vside.com
----------------

-- 
View this message in context: http://www.nabble.com/isVisibilityAllowed%28%29-not-consulted-before-calling-onBeforeRender%28%29--tp20651326p20652229.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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


Re: isVisibilityAllowed() not consulted before calling onBeforeRender()?

Posted by Igor Vaynberg <ig...@gmail.com>.
already on the roadmap/wishlist for 1.5 :)

-igor

On Sun, Nov 23, 2008 at 2:21 PM, Johan Compagner <jc...@gmail.com> wrote:
> We really should straighten this isVisible up.
> Make it final, and let that on check flag and the other isVisible
> things with an overridable method that users can override. (and maybe
> cache this result in a flag for 1 request)
>
> On 11/23/08, Igor Vaynberg <ig...@gmail.com> wrote:
>> sounds like a bug. open a jira issue.
>>
>> -igor
>>
>> On Sun, Nov 23, 2008 at 2:06 PM, dukehoops <ni...@doppelganger.com> wrote:
>>>
>>> I have a component whose parent does this:
>>>
>>> class Parent extends Panel
>>>
>>> private Component child;
>>>
>>> onBeforeRender()
>>> {
>>> child.setVisibilityAllowed(false);
>>> super.onBeforeRender();
>>> }
>>>
>>> I would expect child's onBeforeRender() to not be executed but it is,
>>> because Component.internalBeforeRender calls isVisible() rather than
>>> determineVisibility().
>>>
>>> Is that by design? If so, why?
>>>
>>> If this is a bug, should the following line in
>>> Component.internalBeforeRender():
>>>
>>>                if ((isVisible() || callOnBeforeRenderIfNotVisible()) &&
>>> !getFlag(FLAG_RENDERING) &&
>>>                        !getFlag(FLAG_PREPARED_FOR_RENDER))
>>>
>>> be this:
>>>
>>>                if ((determineVisibility() ||
>>> callOnBeforeRenderIfNotVisible()) &&
>>> !getFlag(FLAG_RENDERING) &&
>>>                        !getFlag(FLAG_PREPARED_FOR_RENDER))
>>>
>>> thanks
>>> -nikita
>>>
>>>
>>>
>>>
>>> -----
>>> ----------------
>>> Nikita Tovstoles
>>> vside.com
>>> ----------------
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/isVisibilityAllowed%28%29-not-consulted-before-calling-onBeforeRender%28%29--tp20651326p20651326.html
>>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: isVisibilityAllowed() not consulted before calling onBeforeRender()?

Posted by Johan Compagner <jc...@gmail.com>.
We really should straighten this isVisible up.
Make it final, and let that on check flag and the other isVisible
things with an overridable method that users can override. (and maybe
cache this result in a flag for 1 request)

On 11/23/08, Igor Vaynberg <ig...@gmail.com> wrote:
> sounds like a bug. open a jira issue.
>
> -igor
>
> On Sun, Nov 23, 2008 at 2:06 PM, dukehoops <ni...@doppelganger.com> wrote:
>>
>> I have a component whose parent does this:
>>
>> class Parent extends Panel
>>
>> private Component child;
>>
>> onBeforeRender()
>> {
>> child.setVisibilityAllowed(false);
>> super.onBeforeRender();
>> }
>>
>> I would expect child's onBeforeRender() to not be executed but it is,
>> because Component.internalBeforeRender calls isVisible() rather than
>> determineVisibility().
>>
>> Is that by design? If so, why?
>>
>> If this is a bug, should the following line in
>> Component.internalBeforeRender():
>>
>>                if ((isVisible() || callOnBeforeRenderIfNotVisible()) &&
>> !getFlag(FLAG_RENDERING) &&
>>                        !getFlag(FLAG_PREPARED_FOR_RENDER))
>>
>> be this:
>>
>>                if ((determineVisibility() ||
>> callOnBeforeRenderIfNotVisible()) &&
>> !getFlag(FLAG_RENDERING) &&
>>                        !getFlag(FLAG_PREPARED_FOR_RENDER))
>>
>> thanks
>> -nikita
>>
>>
>>
>>
>> -----
>> ----------------
>> Nikita Tovstoles
>> vside.com
>> ----------------
>>
>> --
>> View this message in context:
>> http://www.nabble.com/isVisibilityAllowed%28%29-not-consulted-before-calling-onBeforeRender%28%29--tp20651326p20651326.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Re: isVisibilityAllowed() not consulted before calling onBeforeRender()?

Posted by Igor Vaynberg <ig...@gmail.com>.
sounds like a bug. open a jira issue.

-igor

On Sun, Nov 23, 2008 at 2:06 PM, dukehoops <ni...@doppelganger.com> wrote:
>
> I have a component whose parent does this:
>
> class Parent extends Panel
>
> private Component child;
>
> onBeforeRender()
> {
> child.setVisibilityAllowed(false);
> super.onBeforeRender();
> }
>
> I would expect child's onBeforeRender() to not be executed but it is,
> because Component.internalBeforeRender calls isVisible() rather than
> determineVisibility().
>
> Is that by design? If so, why?
>
> If this is a bug, should the following line in
> Component.internalBeforeRender():
>
>                if ((isVisible() || callOnBeforeRenderIfNotVisible()) &&
> !getFlag(FLAG_RENDERING) &&
>                        !getFlag(FLAG_PREPARED_FOR_RENDER))
>
> be this:
>
>                if ((determineVisibility() || callOnBeforeRenderIfNotVisible()) &&
> !getFlag(FLAG_RENDERING) &&
>                        !getFlag(FLAG_PREPARED_FOR_RENDER))
>
> thanks
> -nikita
>
>
>
>
> -----
> ----------------
> Nikita Tovstoles
> vside.com
> ----------------
>
> --
> View this message in context: http://www.nabble.com/isVisibilityAllowed%28%29-not-consulted-before-calling-onBeforeRender%28%29--tp20651326p20651326.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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