On Tue, Jul 22, 2008 at 09:59:48AM -0700, Edbay wrote:
>
> Thanks for the quick reply.
>
> Wouldn't this force all links to have the same wicket ids ("linkid")?
> I'd like to be able to have the line items look like this:
>
> <ul wicket:id="list">
> <li> # Link01 text here </li>
> <li> # Link02 text here </li>
> <li> # Link03 text here </li>
> </ul>
Well, you would only put in one link line. The ListView repeats the
markup for each item in the list. Note that Alexander's example is a
little broken, since it would repeat the entire <ul> for each item,
where I think you want to repeat the <li>.
Personally, I would create a Panel class that encapsulates the link, the
link text, and perhaps any required images, behaviours, etc. Then I
would use a RepeatingView and add as many of these panels as I need:
<ul>
<!-- note: the <a> tag here is only for preview,
it will be replaced by the link panel contents -->
<li wicket:id="menuItem"><a href="#">Foo</a></li>
</ul>
RepeatingView menu = new RepeatingView("menuItem");
menu.add(new MyMenuPanel(menu.newChildId(), "Home", HomePage.class));
if (userIsDarthVader) {
menu.add(new MyMenuPanel(menu.newChildId(), "Enslave Universe",
EnslaveUniversePage.class));
}
jk
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]