[ 
https://issues.apache.org/jira/browse/WICKET-1954?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nikita Tovstoles updated WICKET-1954:
-------------------------------------

    Description: 
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().

Shouldn't the following line in Component.internalBeforeRender():

{noformat}
                if ((isVisible() || callOnBeforeRenderIfNotVisible()) && 
!getFlag(FLAG_RENDERING) &&
                        !getFlag(FLAG_PREPARED_FOR_RENDER))
{noformat}

be this:

{noformat}
                if ((determineVisibility() || callOnBeforeRenderIfNotVisible()) 
&& !getFlag(FLAG_RENDERING) &&
                        !getFlag(FLAG_PREPARED_FOR_RENDER))
{noformat}

  was:
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().

Shouldn't the following line in Component.internalBeforeRender():

{code}

                if ((isVisible() || callOnBeforeRenderIfNotVisible()) && 
!getFlag(FLAG_RENDERING) &&
                        !getFlag(FLAG_PREPARED_FOR_RENDER))
{code}

be this:

{code}
                if ((determineVisibility() || callOnBeforeRenderIfNotVisible()) 
&& !getFlag(FLAG_RENDERING) &&
                        !getFlag(FLAG_PREPARED_FOR_RENDER))
{code}


> Component.isVisibilityAllowed() not consulted before calling onBeforeRender()
> -----------------------------------------------------------------------------
>
>                 Key: WICKET-1954
>                 URL: https://issues.apache.org/jira/browse/WICKET-1954
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.5
>            Reporter: Nikita Tovstoles
>
> 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().
> Shouldn't the following line in Component.internalBeforeRender():
> {noformat}
>                 if ((isVisible() || callOnBeforeRenderIfNotVisible()) && 
> !getFlag(FLAG_RENDERING) &&
>                         !getFlag(FLAG_PREPARED_FOR_RENDER))
> {noformat}
> be this:
> {noformat}
>                 if ((determineVisibility() || 
> callOnBeforeRenderIfNotVisible()) && !getFlag(FLAG_RENDERING) &&
>                         !getFlag(FLAG_PREPARED_FOR_RENDER))
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to