Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
1.3.5
-
None
-
None
Description
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>please click <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()
});
AbstractColumn[] columns = new AbstractColumn[]{
new AbstractColumn(new Model("value")) {
public void populateItem(Item cellItem, String componentId, IModel rowModel)
},
};
IDataProvider dataProvider = new IDataProvider() {
public Iterator iterator(int first, int count)
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 or if the link is made visible in the code, the toobar then displays correctly.