Hi,

On Fri, Jun 28, 2019 at 6:25 PM Boris Goldowsky <bgoldow...@cast.org> wrote:

> What’s the best practice for a list (built in this case with a
> RefreshingView) that has a header, which should be hidden if the list is
> empty?
>
> The most obvious would be to wrap <wicket:enclosure> around the whole
> thing, but the RefreshingView is still considered visible even when empty,
> so that doesn’t work by itself.
>
> I tried adding an onConfigure method to set visibility based on the
> repeater’s size(), but the children don’t actually get added to the
> repeater until after onConfigure runs, so size() always returns 0.
>

Actually the children are added
in org.apache.wicket.markup.repeater.AbstractRepeater#onBeforeRender(), so
you need to override this one, call super.onBeforeRender() and then check
the size.

I'd recommend you to use EnclosureContainer instead of <wicket:enclosure>
because the latter has many known bugs.


>
> There are ways I can brute force this of course.  But is there a clean,
> general solution?
>
> Boris
>
>

Reply via email to