use of com.evolveum.midpoint.web.page.admin.configuration.component.ChooseTypePanel in project midpoint by Evolveum.
the class AssignmentEditorPanel method createOrgContainer.
private WebMarkupContainer createOrgContainer() {
WebMarkupContainer tenantRefContainer = new WebMarkupContainer(ID_CONTAINER_ORG_REF);
ChooseTypePanel tenantRef = new ChooseTypePanel(ID_ORG_CHOOSER, new PropertyModel<ObjectViewDto>(getModel(), AssignmentEditorDto.F_ORG_REF)) {
@Override
protected ObjectQuery getChooseQuery() {
return QueryBuilder.queryFor(OrgType.class, getPageBase().getPrismContext()).item(OrgType.F_TENANT).eq(false).or().item(OrgType.F_TENANT).isNull().build();
}
@Override
protected boolean isSearchEnabled() {
return true;
}
@Override
protected QName getSearchProperty() {
return OrgType.F_NAME;
}
};
tenantRefContainer.add(tenantRef);
tenantRef.setEnabled(getModel().getObject().isEditable());
tenantRefContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
AssignmentEditorDto dto = getModel().getObject();
if (dto != null) {
if (AssignmentEditorDtoType.ROLE.equals(dto.getType())) {
return true;
}
}
return false;
}
});
return tenantRefContainer;
}
use of com.evolveum.midpoint.web.page.admin.configuration.component.ChooseTypePanel in project midpoint by Evolveum.
the class AssignmentEditorPanel method createTenantContainer.
private WebMarkupContainer createTenantContainer() {
WebMarkupContainer tenantRefContainer = new WebMarkupContainer(ID_CONTAINER_TENANT_REF);
ChooseTypePanel tenantRef = new ChooseTypePanel(ID_TENANT_CHOOSER, new PropertyModel<ObjectViewDto>(getModel(), AssignmentEditorDto.F_TENANT_REF)) {
@Override
protected ObjectQuery getChooseQuery() {
return QueryBuilder.queryFor(OrgType.class, getPageBase().getPrismContext()).item(OrgType.F_TENANT).eq(true).build();
}
@Override
protected boolean isSearchEnabled() {
return true;
}
@Override
protected QName getSearchProperty() {
return OrgType.F_NAME;
}
};
tenantRef.setPanelEnabled(getModel().getObject().isEditable());
tenantRefContainer.add(tenantRef);
tenantRefContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
AssignmentEditorDto dto = getModel().getObject();
if (dto != null) {
if (AssignmentEditorDtoType.ROLE.equals(dto.getType())) {
return true;
}
}
return false;
}
});
return tenantRefContainer;
}
Aggregations