use of com.evolveum.midpoint.web.component.input.RelationDropDownChoicePanel in project midpoint by Evolveum.
the class FocusTypeAssignmentPopupTabPanel method initParametersPanel.
@Override
protected void initParametersPanel(Fragment parametersPanel) {
WebMarkupContainer relationContainer = new WebMarkupContainer(ID_RELATION_CONTAINER);
relationContainer.setOutputMarkupId(true);
parametersPanel.add(relationContainer);
List<QName> relationsList = getPredefinedRelation() != null ? Collections.singletonList(getPredefinedRelation()) : getSupportedRelations();
relationContainer.add(new RelationDropDownChoicePanel(ID_RELATION, getDefaultRelationIfInList(relationsList), relationsList, false));
}
use of com.evolveum.midpoint.web.component.input.RelationDropDownChoicePanel in project midpoint by Evolveum.
the class AssignmentEditorPanel method addRelationDropDown.
private void addRelationDropDown(WebMarkupContainer relationContainer) {
QName assignmentRelation = getModelObject().getTargetRef() != null ? getModelObject().getTargetRef().getRelation() : null;
RelationDropDownChoicePanel relationDropDown = new RelationDropDownChoicePanel(ID_RELATION, assignmentRelation != null ? assignmentRelation : WebComponentUtil.getDefaultRelationOrFail(), getSupportedRelations(), false) {
private static final long serialVersionUID = 1L;
@Override
protected void onValueChanged(AjaxRequestTarget target) {
ObjectReferenceType ref = AssignmentEditorPanel.this.getModelObject().getTargetRef();
if (ref != null) {
ref.setRelation(getRelationValue());
}
}
@Override
protected IModel<String> getRelationLabelModel() {
return Model.of();
}
@Override
protected boolean isRelationDropDownEnabled() {
return isRelationEditable();
}
};
relationDropDown.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return isCreatingNewAssignment();
}
});
relationContainer.add(relationDropDown);
}
use of com.evolveum.midpoint.web.component.input.RelationDropDownChoicePanel in project midpoint by Evolveum.
the class MemberPopupTabPanel method initParametersPanel.
@Override
protected void initParametersPanel(Fragment parametersPanel) {
WebMarkupContainer relationContainer = new WebMarkupContainer(ID_RELATION_CONTAINER);
relationContainer.setOutputMarkupId(true);
relationContainer.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return CollectionUtils.isNotEmpty(relationConfig.getSupportedRelations());
}
@Override
public boolean isEnabled() {
return CollectionUtils.isNotEmpty(relationConfig.getSupportedRelations()) && relationConfig.getSupportedRelations().size() > 1;
}
});
parametersPanel.add(relationContainer);
relationContainer.add(new RelationDropDownChoicePanel(ID_RELATION, getDefaultRelation(), relationConfig.getSupportedRelations(), false));
}
use of com.evolveum.midpoint.web.component.input.RelationDropDownChoicePanel in project midpoint by Evolveum.
the class AbstractShoppingCartTabPanel method initRelationPanel.
private void initRelationPanel(WebMarkupContainer parametersPanel) {
WebMarkupContainer relationContainer = new WebMarkupContainer(ID_RELATION_CONTAINER);
relationContainer.setOutputMarkupId(true);
parametersPanel.add(relationContainer);
List<QName> assignableRelationsList = getAvailableRelationsList();
if (CollectionUtils.isNotEmpty(assignableRelationsList)) {
if (assignableRelationsList.contains(SchemaConstants.ORG_DEFAULT)) {
getRoleCatalogStorage().setSelectedRelation(SchemaConstants.ORG_DEFAULT);
} else {
getRoleCatalogStorage().setSelectedRelation(assignableRelationsList.get(0));
}
}
relationContainer.add(new RelationDropDownChoicePanel(ID_RELATION, getRoleCatalogStorage().getSelectedRelation(), assignableRelationsList, false) {
private static final long serialVersionUID = 1L;
@Override
protected void onValueChanged(AjaxRequestTarget target) {
getRoleCatalogStorage().setSelectedRelation(getRelationValue());
target.add(AbstractShoppingCartTabPanel.this);
}
@Override
protected IModel<String> getRelationLabelModel() {
return Model.of();
}
});
}
Aggregations