Sorry Gmail sent before I was finished. Just take what was before and where
the List view's populateListItem method goes, implement the list view's
method with something like:

 protected void populateItem(ListItem<MenuItem> item)
{
   item.add(new MenuItemPanel("menu", item.getModel());
}

That way you can have more that 2 levels too.

Also please forgive the code, it is rushed in the gmail editor and has not
been even close to compiled.

Steve

On Tue, May 25, 2010 at 10:24 PM, Steve Mactaggart <
[email protected]> wrote:

> I guess the other issue is what is the data like?
>
> If you had a class called MenuItem that had a name and a List<MenuItem> as
> children then you could create a panel
>
> MenuItemPanel extends Panel {
>
>   public MenuItemPanel(String id, IModel<MenuItem> model) {
>   {
>     super(id, model);
>
>     add(new Label("category", model.getModelObject().getName());
>
>     ListView menuOptions = new ListView<MenuItem>("menus",
> model.getModelObject().getChildren()) {
> protected void populateItem(ListItem<ContactDetail> item) {
>
>     };
>
>     add(menuOptions);
>
>   }
>
> }
>
>
> On Tue, May 25, 2010 at 1:02 AM, vp143 <[email protected]>wrote:
>
>>
>> I forgot to mention that I require the HTML markup to be like the
>> following:
>>
>> <ul>
>>    <li>Category 1</li>
>>    <li>Category 2</li>
>>    <li>
>>        <ul>
>>            <li> # Category 2 - Sub category 1 </li>
>>            <li> # Category 2 - Sub category 2 </li>
>>        </ul>
>>    </li>
>> </ul>
>> --
>> View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/Wicket-Dynamic-Navigation-tp2228587p2228687.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>

Reply via email to