use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.
the class LdapForm method onRefreshSubmit.
@Override
protected void onRefreshSubmit(AjaxRequestTarget target, Form<?> form) {
LdapConfig ldapConfig = this.getModelObject();
if (ldapConfig.getId() != null) {
ldapConfig = ldapDao.get(ldapConfig.getId());
} else {
ldapConfig = new LdapConfig();
}
this.setModelObject(ldapConfig);
target.add(this);
reinitJs(target);
}
use of org.apache.openmeetings.db.entity.server.LdapConfig in project openmeetings by apache.
the class LdapsPanel method onInitialize.
@Override
protected void onInitialize() {
SearchableDataView<LdapConfig> dataView = new SearchableDataView<LdapConfig>("ldapList", new SearchableDataProvider<>(LdapConfigDao.class)) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(final Item<LdapConfig> item) {
final LdapConfig lc = item.getModelObject();
item.add(new Label("id"));
item.add(new Label("name"));
item.add(new Label("configFileName"));
item.add(new AjaxEventBehavior(EVT_CLICK) {
private static final long serialVersionUID = 1L;
@Override
protected void onEvent(AjaxRequestTarget target) {
form.setModelObject(lc);
form.hideNewRecord();
target.add(form, listContainer);
reinitJs(target);
}
});
item.add(AttributeModifier.replace(ATTR_CLASS, getRowClass(lc.getId(), form.getModelObject().getId())));
}
};
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<>(listContainer, dataView, navigator);
container.addLink(new OmOrderByBorder<>("orderById", "id", container)).addLink(new OmOrderByBorder<>("orderByName", "name", container)).addLink(new OmOrderByBorder<>("orderByFile", "configFileName", container));
add(container.getLinks());
add(navigator);
form = new LdapForm("form", listContainer, new LdapConfig());
form.showNewRecord();
add(form);
super.onInitialize();
}
Aggregations