Hi Garret,
did you try this?

<ul>
   <li wicket:id="foo">foo</li>
   <li>bar</li>
</ul>

Everything can be a WebMarkupContainer. No need to always use <div>s or 
<span>s.

have a nice weekend
Patrick

Am 07.11.2014 17:32, schrieb Garret Wilson:
> All,
>
> I have a little list in HTML:
>
>     <ul>
>        <li>foo</li>
>        <li>bar</li>
>     </ul>
>
>
> There are some <wicket:message> tags, but no components on the page. I
> want only to show the "foo" list item if the flag variable is set to
> true. What's the easiest way to do this in Wicket?
>
> I've read the documentation on controlling HTML
> <http://wicket.apache.org/guide/guide/keepControl.html>. It seems I can
> use a WebMarkupContainer, but only if I add some extra HTML. Obviously I
> don't want this:
>
>     <ul>
>        <div wicket:id="foo"><li>foo</li></div>
>        <li>bar</li>
>     </ul>
>
>
> It seems I can also use a Fragment (which presumably wouldn't require
> the extra HTML because it would use <wicket:fragment>, but the
> constructor for that component requires that I specify the Wicket ID of
> the "container", which doesn't exist.
>
> How can I simply reference some piece of HTML so that I can show or hide
> it based on some flag?
>
> Garret
>

Reply via email to