Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

hiding a bit of markup

$
0
0
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

Viewing all articles
Browse latest Browse all 5648

Trending Articles