You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Daniel Stoch <da...@gmail.com> on 2011/09/05 12:29:14 UTC

setRenderAllowed called for invisible components

Hi,

Is it a valid behavior that setRenderAllowed(...) method is called for
invisible components (components that are not visible in hierarchy).
I have a use case with DataView component displaying list of links.
When I hide this DataView (eg. by setting dataView.setVisible(false))
then for each of the links components (created in previous request)
setRenderAllowed(...) method is called.

I have a quickstart app to simulate this, but I don't know is it a bug
and should I create JIRA issue for this?

--
Daniel

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


Re: setRenderAllowed called for invisible components

Posted by Daniel Stoch <da...@gmail.com>.
Hi,

Yes, it should be called also on invisible components, but only when
it is any chance that these components can be rendered. If one of
theirs parents are not visible, then such component will not be
rendered.

In my scenario DataView is visible only when "dataView.getItemCount()
> 0". But it leads to an abnormal situation:
1. First request: dataView.getItemCount()=3 so DataView renders 3
subitems (children).
2. Second request: dataView.getItemCount()=0 (eg. someone remove all 3
records from DB), so I set DataView.setVisible(false), but DataView
subitems are not removed from its children list before calling
DataView.setRenderAllowed (MarkupContainer.setRenderAllowed).
MarkupContainer.setRenderAllowed calls setRenderAllowed for all 3
subitems in visitChildren(...). But these subitems should not exists
in current request because dataView.getItemCount()=0. They are not
removed from DataView because it is not visible and calling
setRenderAllowed for these subitems is a bug for me.


--
Daniel

On Mon, Sep 5, 2011 at 4:21 PM, Andrea Del Bene <ad...@ciseonweb.it> wrote:
> Hi,
>
> I'm not completely  sure, but setRenderAllowed is called to check rendering
> authorization, so it should be called also on invisible components.
>>

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


Re: setRenderAllowed called for invisible components

Posted by Andrea Del Bene <ad...@ciseonweb.it>.
Hi,

I'm not completely  sure, but setRenderAllowed is called to check 
rendering authorization, so it should be called also on invisible 
components.
> Wicket 1.4.18
>
> On Mon, Sep 5, 2011 at 12:29 PM, Daniel Stoch<da...@gmail.com>  wrote:
>> Hi,
>>
>> Is it a valid behavior that setRenderAllowed(...) method is called for
>> invisible components (components that are not visible in hierarchy).
>> I have a use case with DataView component displaying list of links.
>> When I hide this DataView (eg. by setting dataView.setVisible(false))
>> then for each of the links components (created in previous request)
>> setRenderAllowed(...) method is called.
>>
>> I have a quickstart app to simulate this, but I don't know is it a bug
>> and should I create JIRA issue for this?
>>
>> --
>> Daniel
>>
> ---------------------------------------------------------------------
> 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: setRenderAllowed called for invisible components

Posted by Daniel Stoch <da...@gmail.com>.
Wicket 1.4.18

On Mon, Sep 5, 2011 at 12:29 PM, Daniel Stoch <da...@gmail.com> wrote:
> Hi,
>
> Is it a valid behavior that setRenderAllowed(...) method is called for
> invisible components (components that are not visible in hierarchy).
> I have a use case with DataView component displaying list of links.
> When I hide this DataView (eg. by setting dataView.setVisible(false))
> then for each of the links components (created in previous request)
> setRenderAllowed(...) method is called.
>
> I have a quickstart app to simulate this, but I don't know is it a bug
> and should I create JIRA issue for this?
>
> --
> Daniel
>

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