I tried to make the Menubar (from extensions 2.0) work for wicket 1.3.
I ran into trouble...
When searching for LoopItem and Loop I ran into this post, I thought may be
related to the same problem I have now..
The java component markup hierarchy doesn't match the template hierarchy:
It should be:
[Component id = menuTitle, page = view.menubar.MenuBarPage, path =
1:menuBar:menubar:menus:0:menuTitle.Label, isVisible = true, isVersioned =
false]
But it says:
[Component id = -relative_path_prefix4, page = view.menubar.MenuBarPage,
path = 1:menuBar:menubar:menus:0:-relative_path_prefix4.WebMarkupContainer,
isVisible = true, isVersioned = true]
Code for the menubar panel:
<wicket:panel>
<ul wicket:id="menubar">
<li wicket:id="menus">
[[Menu title]]
Place menus here
</li>
</ul>
</wicket:panel>
Java code (only the relevant part, I think):
public MenuBarPanel(final String id, final List<Menu> menus, final String
name) {
super(id);
this.menus = menus;
this.name = name;
init();
WebMarkupContainer menuBar = new WebMarkupContainer("menubar");
menuBar.add(new AttributeModifier("id", true, new Model(name)));
// add the loop used to generate each single menu
menuBar.add(new Loop("menus", menus.size()) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(LoopItem item) {
final int index = item.getIteration();
final Menu menu = MenuBarPanel.this.menus.get(index);
if (menu.isVisible()) {
item.add(new Label("menuTitle",
menu.getModel()).setRenderBodyOnly(true));
MenuPanel mp = new MenuPanel("menu", menu.getMenuItems());
item.add(mp);
mp.setRenderBodyOnly(true);
}
});
add(menuBar);
}
}
I looked for "relative_path_prefix", and it's for components with no id ???
I'm a bit lost...
Johan Compagner wrote:
>
> the LoopItem is the parent of the panel
>
> new MenuPanel(item, "menu", menu.getModel(), menu.getMenuItems());
>
> On 9/29/06, Stefan Lindner <[EMAIL PROTECTED]> wrote:
>>
>> I have a Panel that looks like this (html)
>>
>> <hr />
>> <ul id="nav" wicket:id="menus">
>> <!-- Place menus here-->
>> Place menus here
>>
>> </ul>
>> <hr />
>>
>> Now I want to generate Panels for wicket id "menu" like this
>>
>> new Loop(this, "menus", menus.size()) {
>> private static final long serialVersionUID = 1L;
>> @Override
>> protected void populateItem(LoopItem item) {
>> final int index = item.getIteration();
>> final Menu menu = MenuBarPanel.this.menus.get(index);
>>
>> new MenuPanel(?????, "menu", menu.getModel(), menu.getMenuItems());
>>
>> I can't use the item for ????? because it's not a markupContainer. So,
>> what is the correct MarkupContainer for the panels?
>>
>> Stefan Lindner
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys -- and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> Wicket-user mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/wicket-user
>>
>>
>>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
--
View this message in context:
http://www.nabble.com/Creating-Panels-inside-of-Loop-%28Wicket-2%29-tf2355282.html#a10772100
Sent from the Wicket - User mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user