nested - Wicket listview within a listview -
i pretty new wicket i'm making horrible mistake here.
i trying add listview listview receive error, know error has hierarchy of components , because hierarchy of java file , html file not same. don't know how solve it. give me pointers?
relevant code (setting listviews):
final listview<menuitem> sublistview = new listview<menuitem>("menusubview", new arraylist<menuitem>()) { private static final long serialversionuid = 1l; @override protected void populateitem(listitem<menuitem> item) { //do } }; sublistview.setrenderbodyonly(true); sublistview.setreuseitems(true); listview<menuitem> listview = new listview<menuitem>("menuview", menuitems) { private static final long serialversionuid = 1l; @override protected void populateitem(listitem<menuitem> item) { final menuitem menuitem = item.getmodelobject(); ajaxlink<menuitem> alink = new ajaxlink<menuitem>("menuitemlink") { private static final long serialversionuid = 1l; @override public void onclick(ajaxrequesttarget target) { if(target != null) { //do } } }; alink.add(new label("linktext", menuitem.gettext())); item.add(alink); item.add(sublistview); }
html:
<wicket:panel> <ul wicket:id="menuview"> <li> <a href="#" wicket:id="menuitemlink" > <span wicket:id="linktext"></span> </a> <ul wicket:id="menusubview"> <li> <div wicket:id="subitemtext"></div> </li> </ul> </li> </ul>
error:
unable find component id 'menusubview' in [listitem [component id = 0]] expected: 'viewerpanel:optionsmenu:menuview:0.menusubview'. found similar names: 'viewerpanel:optionsmenu:menuview:1:menusubview' markupstream: [markup = file:.../panels/menu/simplemenu.html
</li> --> , index = 9, current = '' (line 0, column 0)] @ org.apache.wicket.markup.markupstream.throwmarkupexception(markupstream.java:526) @ org.apache.wicket.markupcontainer.rendernext(markupcontainer.java:1435) ....
thank in advance replying.
kind regards, bram
Comments
Post a Comment