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