use of com.evolveum.midpoint.web.component.data.column.ObjectNameColumn in project midpoint by Evolveum.
the class PageAttorneySelection method initLayout.
private void initLayout() {
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
ObjectListPanel<UserType> table = new ObjectListPanel<>(ID_TABLE, UserType.class, Collections.emptyList()) {
@Override
protected UserProfileStorage.TableId getTableId() {
return UserProfileStorage.TableId.PAGE_USER_SELECTION;
}
@Override
protected IColumn<SelectableBean<UserType>, String> createCheckboxColumn() {
return null;
}
@Override
protected IColumn<SelectableBean<UserType>, String> createNameColumn(IModel<String> displayModel, GuiObjectColumnType customColumn, ItemPath itemPath, ExpressionType expression) {
return new ObjectNameColumn<>(createStringResource("ObjectType.name")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target, IModel<SelectableBean<UserType>> rowModel) {
UserType object = rowModel.getObject().getValue();
selectUserPerformed(object.getOid());
}
};
}
@Override
protected List<IColumn<SelectableBean<UserType>, String>> createDefaultColumns() {
List<IColumn<SelectableBean<UserType>, String>> columns = new ArrayList<>();
columns.add(createNameColumn(null, null, null, null));
columns.addAll(PageAttorneySelection.this.initColumns());
return columns;
}
@Override
protected List<InlineMenuItem> createInlineMenu() {
return null;
}
@Override
protected ISelectableDataProvider<UserType, SelectableBean<UserType>> createProvider() {
return createSelectableBeanObjectDataProvider(() -> getAttorneySelectionQuery(), null);
}
};
table.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_USER_BOX_CSS_CLASSES);
table.setOutputMarkupId(true);
mainForm.add(table);
}
Aggregations