Wicket:enclosure does not work with navigation toolbar of data table
--------------------------------------------------------------------

                 Key: WICKET-2182
                 URL: https://issues.apache.org/jira/browse/WICKET-2182
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.3.5
            Reporter: Robin Shine


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() {
        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 or if the link is made 
visible in the code, the toobar then displays correctly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to