One of the things I dislike is when I have to implement my own
visibility logic when a ListView is empty, mostly when using
enclosures to wrap around surrounding markup.

So for a ListView<Address> I have to implement an onConfigure that
calls setVisible(!getList().isEmpty()); to tell the enclosure that it
should not render the enclosed markup.

<wicket:enclosure child="addresses">
<h2>Addresses</h2>
<dl>
<wicket:container wicket:id="addresses">
  <dt>Address</dt>
  <dd><wicket:container wicket:id="address"></wicket:container></dd>
</wicket:container>
</dl>
</wicket:enclosure>

I figure we can make that the default. There is little point in having
a visible, empty ListView, is there?

Another option would be to make wicket:enclosure smarter, but that is
a rabbit hole I'd like leave closed.

Martijn

Reply via email to