Search in sources :

Example 11 with EmptyOnBlurAjaxFormUpdatingBehaviour

use of com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour in project midpoint by Evolveum.

the class ParameterPropertiesPopupPanel method addTextPanel.

private void addTextPanel(String id, String expression) {
    TextPanel<String> keyPanel = new TextPanel<>(id, new PropertyModel<>(getModel(), expression));
    keyPanel.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
    add(keyPanel);
}
Also used : EmptyOnBlurAjaxFormUpdatingBehaviour(com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour) TextPanel(com.evolveum.midpoint.web.component.input.TextPanel)

Example 12 with EmptyOnBlurAjaxFormUpdatingBehaviour

use of com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour in project midpoint by Evolveum.

the class RunReportPopupPanel method createTypedInputPanel.

private InputPanel createTypedInputPanel(String componentId, IModel<JasperReportValueDto> model, String expression, JasperReportParameterDto param) {
    InputPanel panel;
    Class<?> type;
    try {
        if (param.isMultiValue()) {
            type = param.getNestedType();
        } else {
            type = param.getType();
        }
    } catch (ClassNotFoundException e) {
        getSession().error("Could not find parameter type definition. Check the configuration.");
        throw new RestartResponseException(getPageBase());
    }
    if (type.isEnum()) {
        panel = WebComponentUtil.createEnumPanel(type, componentId, new PropertyModel<>(model, expression), this);
    } else if (XMLGregorianCalendar.class.isAssignableFrom(type)) {
        panel = new DatePanel(componentId, new PropertyModel<>(model, expression));
    } else if (param.getProperties() != null && param.getProperties().getTargetType() != null) {
        // render autocomplete box
        LookupTableType lookup = new LookupTableType();
        panel = new AutoCompleteTextPanel<String>(componentId, new LookupPropertyModel<>(model, expression, lookup, false), String.class) {

            @Override
            public Iterator<String> getIterator(String input) {
                return prepareAutoCompleteList(input, lookup, param).iterator();
            }
        };
    } else {
        panel = new TextPanel<>(componentId, new PropertyModel<>(model, expression), type);
    }
    List<FormComponent> components = panel.getFormComponents();
    for (FormComponent component : components) {
        component.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
    }
    panel.setOutputMarkupId(true);
    return panel;
}
Also used : FormComponent(org.apache.wicket.markup.html.form.FormComponent) InputPanel(com.evolveum.midpoint.web.component.prism.InputPanel) LookupPropertyModel(com.evolveum.midpoint.web.model.LookupPropertyModel) PropertyModel(org.apache.wicket.model.PropertyModel) EmptyOnBlurAjaxFormUpdatingBehaviour(com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) XMLGregorianCalendar(javax.xml.datatype.XMLGregorianCalendar) RestartResponseException(org.apache.wicket.RestartResponseException) DatePanel(com.evolveum.midpoint.web.component.input.DatePanel) Iterator(java.util.Iterator) LookupPropertyModel(com.evolveum.midpoint.web.model.LookupPropertyModel) LookupTableType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType)

Aggregations

EmptyOnBlurAjaxFormUpdatingBehaviour (com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour)12 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)6 Label (org.apache.wicket.markup.html.basic.Label)6 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)5 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)5 PropertyModel (org.apache.wicket.model.PropertyModel)5 InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)4 TextField (org.apache.wicket.markup.html.form.TextField)4 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)3 AttributeModifier (org.apache.wicket.AttributeModifier)3 ListItem (org.apache.wicket.markup.html.list.ListItem)3 ListView (org.apache.wicket.markup.html.list.ListView)3 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)3 DatePanel (com.evolveum.midpoint.web.component.input.DatePanel)2 DropDownChoicePanel (com.evolveum.midpoint.web.component.input.DropDownChoicePanel)2 TextPanel (com.evolveum.midpoint.web.component.input.TextPanel)2 EmptyOnChangeAjaxFormUpdatingBehavior (com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior)2 Date (java.util.Date)2 List (java.util.List)2 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)2