, new SearchableDataProvider<LdapConfig>(LdapConfigDao.class)) {
private static final long serialVersionUID = 8715559628755439596L;
@Override
protected void populateItem(final Item<LdapConfig> item) {
final LdapConfig lc = item.getModelObject();
item.add(new Label("ldapConfigId", "" + lc.getLdapConfigId()));
item.add(new Label("name", "" + lc.getName()));
item.add(new Label("configFileName", "" + lc.getConfigFileName()));
item.add(new AjaxEventBehavior("onclick") {
private static final long serialVersionUID = -8069413566800571061L;
protected void onEvent(AjaxRequestTarget target) {
form.setModelObject(lc);
form.hideNewRecord();
target.add(form, listContainer);
target.appendJavaScript("omLdapPanelInit();");
}
});
item.add(AttributeModifier.replace("class", "clickable "
+ ((item.getIndex() % 2 == 1) ? "even" : "odd")
+ (lc.getLdapConfigId() == form.getModelObject().getLdapConfigId() ? " selected" : "")));
}
};
add(listContainer.add(dataView).setOutputMarkupId(true));
PagedEntityListPanel navigator = new PagedEntityListPanel("navigator", dataView) {
private static final long serialVersionUID = -1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
target.add(listContainer);
}
};
DataViewContainer<LdapConfig> container = new DataViewContainer<LdapConfig>(listContainer, dataView, navigator);
container.setLinks(new OmOrderByBorder<LdapConfig>("orderById", "ldapConfigId", container)
, new OmOrderByBorder<LdapConfig>("orderByName", "name", container)
, new OmOrderByBorder<LdapConfig>("orderByFile", "configFileName", container));
add(container.orderLinks);
add(navigator);
form = new LdapForm("form", listContainer, new LdapConfig());
form.showNewRecord();
add(form);
}