Search in sources :

Example 1 with ExpressionEditorPanel

use of com.evolveum.midpoint.web.component.input.ExpressionEditorPanel in project midpoint by Evolveum.

the class ConditionalSearchFilterEditor method initLayout.

protected void initLayout(PageResourceWizard parentPage) {
    ExpressionEditorPanel expressionEditor = new ExpressionEditorPanel(ID_EXPRESSION_PANEL, new PropertyModel<>(getModel(), ConditionalSearchFilterType.F_CONDITION.getLocalPart()), parentPage) {

        @Override
        public void performExpressionHook(AjaxRequestTarget target) {
            if (getExpressionDtoModel().getObject() != null) {
                ExpressionType expression = getExpressionDtoModel().getObject().getExpressionObject();
                ConditionalSearchFilterEditor.this.getModel().getObject().setCondition(expression);
            }
        }

        @Override
        public String getTypeLabelKey() {
            return "ConditionalSearchFilterEditor.condition.type.label";
        }

        @Override
        public String getDescriptionLabelKey() {
            return "ConditionalSearchFilterEditor.condition.description.label";
        }

        @Override
        public String getUpdateLabelKey() {
            return "ConditionalSearchFilterEditor.condition.update.label";
        }

        @Override
        public String getExpressionLabelKey() {
            return "ConditionalSearchFilterEditor.condition.label";
        }
    };
    add(expressionEditor);
    SearchFilterPanel filterClauseEditor = new SearchFilterPanel<>(ID_FILTER_CLAUSE_PANEL, (NonEmptyModel<ConditionalSearchFilterType>) getModel(), parentPage.getReadOnlyModel());
    add(filterClauseEditor);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ConditionalSearchFilterType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConditionalSearchFilterType) SearchFilterPanel(com.evolveum.midpoint.web.component.input.SearchFilterPanel) ExpressionType(com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType) ExpressionEditorPanel(com.evolveum.midpoint.web.component.input.ExpressionEditorPanel)

Example 2 with ExpressionEditorPanel

use of com.evolveum.midpoint.web.component.input.ExpressionEditorPanel in project midpoint by Evolveum.

the class SynchronizationExpressionEditor method initLayout.

protected void initLayout(PageResourceWizard parentPage) {
    Label label = new Label(ID_LABEL, new IModel<String>() {

        @Override
        public String getObject() {
            return getString(getLabel());
        }
    });
    add(label);
    ExpressionEditorPanel expressionEditor = new ExpressionEditorPanel(ID_EXPRESSION_EDITOR, getModel(), parentPage);
    add(expressionEditor);
}
Also used : Label(org.apache.wicket.markup.html.basic.Label) ExpressionEditorPanel(com.evolveum.midpoint.web.component.input.ExpressionEditorPanel)

Aggregations

ExpressionEditorPanel (com.evolveum.midpoint.web.component.input.ExpressionEditorPanel)2 SearchFilterPanel (com.evolveum.midpoint.web.component.input.SearchFilterPanel)1 ConditionalSearchFilterType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConditionalSearchFilterType)1 ExpressionType (com.evolveum.midpoint.xml.ns._public.common.common_3.ExpressionType)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 Label (org.apache.wicket.markup.html.basic.Label)1