I'd use a ListView :)
Assuming this lil code
add( new ListView(list, linkList )
{
public void populateItem(ListItem item)
{
item.add( (Link)linkList );
}
});
You'd have the html look something like this
ul wicket:id=list
lia href=#
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
Alexander
]
Sendt: 22. juli 2008 19:00
Til: users@wicket.apache.org
Emne: RE: How to build a dynamic navigation bar
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
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
Edbay wrote:
I tried using ListView, but I could not get it to work, as it forces the
wicket id of the line items to be all the same.
Why is that a problem? Using ListView should be a good solution. Could you
elaborate?
--
View this message in context:
. Just create as many links as you want/need, with whatever
behaviour they need. Just make sure they all have the same id :)
Alex
-Opprinnelig melding-
Fra: Edbay [mailto:[EMAIL PROTECTED]
Sendt: 22. juli 2008 19:00
Til: users@wicket.apache.org
Emne: RE: How to build a dynamic navigation
I get this approach. Can you provide the code for the panel?
ul
!-- note: the tag here is only for preview,
it will be replaced by the link panel contents --
li wicket:id=menuItem # Foo /li
/ul
RepeatingView menu = new RepeatingView(menuItem);
menu.add(new
Something like this...
wicket:panel
a wicket:id=linkspan wicket:id=labelFoo/span/a
/wicket:panel
public class MyMenuPanel extends Panel {
public MyMenuPanel(String id, String label, Class pageClass) {
super(id);
Link link = new BookmarkablePageLink(link, pageClass);
add(link);
Works!
:clap:
wicket:panel
Foo
/wicket:panel
public class MyMenuPanel extends Panel {
public MyMenuPanel(String id, String label, Class pageClass) {
super(id);
Link link = new BookmarkablePageLink(link, pageClass);
add(link);
link.add(new Label(label, label));
}
}