i’m using wicket 1.5.7, i wanted to create a link in a cell in DefaultDataTable.
so i copied the example in this page, but i get runtime error from wicket:
Last cause: Failed to find markup file associated. ActionPanel: [ActionPanel [Component id = cell]]
here’s some of my code:
public GroupsList(final PageParameters parameters)
{
ArrayList<IColumn> columns = new ArrayList<IColumn>();
columns.add(new AbstractColumn<Group>(new Model<String>("Actions"))
{
public void populateItem(Item<ICellPopulator<Group>> cellItem, String componentId,
IModel<Group> model)
{
cellItem.add(new ActionPanel(componentId, model));
}
});
add(new DefaultDataTable("table", columns, new GroupDataProvider(), 8));
}
and here’s my ActionPanel
class ActionPanel extends Panel
{
public ActionPanel(String id, IModel<Group> model)
{
super(id, model);
add(new Link("select")
{
@Override
public void onClick()
{
PageParameters pp = new PageParameters();
setResponsePage(new HomePage(pp));
}
});
}
}
any ideas what is the root cause?
Judging from the error message you are missing your ActionPanel.html. Either it’s misnamed, misplaced or completely missing. As Panels go, they need their markup. In case of the example mentioned, the markup file is “hidden” as BasePage$ActionPanel.html since the ActionPanel is an inner class of BasePage.