, new SearchableDataProvider<Configuration>(ConfigurationDao.class)) {
private static final long serialVersionUID = 8715559628755439596L;
@Override
protected void populateItem(final Item<Configuration> item) {
final Configuration configuration = item.getModelObject();
item.add(new Label("configuration_id", "" + configuration.getConfiguration_id()));
item.add(new Label("conf_key", "" + configuration.getConf_key()));
item.add(new Label("conf_value", "" + configuration.getConf_value()));
item.add(new AjaxEventBehavior("onclick") {
private static final long serialVersionUID = -8069413566800571061L;
protected void onEvent(AjaxRequestTarget target) {
form.hideNewRecord();
form.setModelObject(configuration);
target.add(form);
target.appendJavaScript("omConfigPanelInit();");
}
});
item.add(AttributeModifier.replace("class", "clickable "
+ ((item.getIndex() % 2 == 1) ? "even" : "odd")));
}
};
final WebMarkupContainer listContainer = new WebMarkupContainer("listContainer");
add(listContainer.add(dataView).setOutputMarkupId(true));
DataViewContainer<Configuration> container = new DataViewContainer<Configuration>(listContainer, dataView);
container.setLinks(new OrderByBorder<Configuration>("orderById", "configuration_id", container)
, new OrderByBorder<Configuration>("orderByKey", "conf_key", container)
, new OrderByBorder<Configuration>("orderByValue", "conf_value", container));
add(container.orderLinks);
add(new PagedEntityListPanel("navigator", dataView) {
private static final long serialVersionUID = 5097048616003411362L;
@Override
protected void onEvent(AjaxRequestTarget target) {
target.add(listContainer);
}
});
form = new ConfigForm("form", listContainer, new Configuration());
form.showNewRecord();
add(form);
}