+1

-igor


On 8/15/07, Johan Compagner <[EMAIL PROTECTED]> wrote:
>
> in that method we do now:
>
>         if (!getFlag(FLAG_RENDERING) &&
> !getFlag(FLAG_PREPARED_FOR_RENDER))
>         {
>             setFlag(FLAG_BEFORE_RENDERING_SUPER_CALL_VERIFIED, false);
>
>             onBeforeRender();
>             getApplication().notifyComponentOnBeforeRenderListeners(this);
>             if (!getFlag(FLAG_BEFORE_RENDERING_SUPER_CALL_VERIFIED))
>             {
>                 throw new IllegalStateException(Component.class.getName()
> +
>                         " has not been properly rendered. Something in the
> hierarchy of " +
>                         getClass().getName() +
>                         " has not called super.onBeforeRender() in the
> override of onBeforeRender() method");
>             }
>         }
>
>
> i think we should do:
>
>         if (isVisible() && !getFlag(FLAG_RENDERING) &&
> !getFlag(FLAG_PREPARED_FOR_RENDER))
>         {
>             setFlag(FLAG_BEFORE_RENDERING_SUPER_CALL_VERIFIED, false);
>
>             onBeforeRender();
>             getApplication().notifyComponentOnBeforeRenderListeners(this);
>             if (!getFlag(FLAG_BEFORE_RENDERING_SUPER_CALL_VERIFIED))
>             {
>                 throw new IllegalStateException(Component.class.getName()
> +
>                         " has not been properly rendered. Something in the
> hierarchy of " +
>                         getClass().getName() +
>                         " has not called super.onBeforeRender() in the
> override of onBeforeRender() method");
>             }
>         }
>
> because calling onBeforeRender when a component isn't rendered is a bit
> strange
> And in onBeforeRender we now touch models and so on (for example
> getModelType() of FormComponent)
> which is really wrong for components that aren't visible
>
> In the repeaters we already have the check in onBeforeRender:
>
> protected void onBeforeRender()
>     {
>         if (isVisibleInHierarchy())
>         {
>
> So that for all its child components (that could be there or could be
> made)
> the on before render isn't called anyway!
>
> But that is visible shouldn't be needed there or done there in
> onBeforeRender on all components if they aren't visible.
>
> johan
>

Reply via email to