Hi Anton, The enclosure tag does not need to have a child attribute if there is only one child enclosed. OTOH, the problem remains the same even if you add the child attribute.
Regards Robin --- On Thu, 3/19/09, Anton Veretennikov <[email protected]> wrote: From: Anton Veretennikov <[email protected]> Subject: Re: Wicket:enclosure does not work with navigation toolbar of data table To: [email protected] Date: Thursday, March 19, 2009, 11:09 PM wicket:enclosure must have "child" attribute to know which child component to ask about visibility? Example: <wicket:enclosure child="name"> <tr><th>First</th><td wicket:id="first"></td></tr> <tr><th>Last</th><td wicket:id="last"></td></tr> </wicket:enclosure> -- Tony On Thu, Mar 19, 2009 at 4:04 PM, Leszek Gawron <[email protected]> wrote: > Robin Shine wrote: >> >> Hi All, >> It seems that the navigation toolbar of data table component can not be >> displayed if there is a link on the page surrounded with the >> wicket:enclosure tag. Here is my very simple test case: >> >> TestPage.html: >> >> <html xmlns="http://www.w3.org/1999/xhtml"> >> <head> >> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> >> </head> >> <body> >> <wicket:enclosure><a wicket:id="link">link</a></wicket:enclosure> >> <table wicket:id="data"></table> >> </body> >> </html> >> >> TestPage.java: >> >> package test; >> >> import java.io.Serializable; >> import java.util.ArrayList; >> import java.util.Iterator; >> import java.util.List; >> >> import >> org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn; >> import >> org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable; >> import >> org.apache.wicket.extensions.markup.html.repeater.data.table.NavigationToolbar; >> import org.apache.wicket.markup.html.WebPage; >> import org.apache.wicket.markup.html.basic.Label; >> import org.apache.wicket.markup.html.link.Link; >> import org.apache.wicket.markup.repeater.Item; >> import org.apache.wicket.markup.repeater.data.IDataProvider; >> import org.apache.wicket.model.IModel; >> import org.apache.wicket.model.Model; >> >> public class TestPage extends WebPage { public TestPage() { >> add(new Link("link") { >> @Override >> public void onClick() { >> } �...@override >> public boolean isVisible() { >> return false; >> } >> }); >> AbstractColumn[] columns = new AbstractColumn[]{ >> new AbstractColumn(new Model("value")) { >> public void populateItem(Item cellItem, String componentId, IModel >> rowModel) { >> cellItem.add(new Label(componentId, rowModel.getObject().toString())); >> } }, >> }; >> IDataProvider dataProvider = new IDataProvider() { >> public Iterator iterator(int first, int count) { >> List<String> values = new ArrayList<String>(); >> for (int i=0; i<count; i++) >> values.add(String.valueOf(i + first)); >> return values.iterator(); >> } >> public int size() { >> return 100; >> } >> public IModel model(Object object) { >> return new Model((Serializable) object); >> } >> public void detach() { >> } >> }; >> DataTable dataTable = new DataTable("data", columns, dataProvider, 10); >> dataTable.addBottomToolbar(new NavigationToolbar(dataTable)); >> add(dataTable); >> } >> } >> >> Add this page to a wicket application, then mount and navigate to the >> page: >> The navigation toolbar of the data table is not displayed. However if the >> "wicket:enclosure" tag is removed from the template, the toobar then >> displays correctly. >> Is this a bug? Or is there anything obvious I missed? > > I stumbled upon exactly the same poblem. The only thing I can tell you: you > don't need wicket:enclosure in your case. Simply remove the tag and as > Link.isVisible returns false it will not be rendered. > > If you put anything else apart from <link/> into wicket:enclosure you should > see correct behavior. > > This probably IS a bug. File a JIRA request for that. > > -- > Leszek Gawron > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
