Search in sources :

Example 41 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class PageConnectorHosts method initLayout.

protected void initLayout() {
    Form mainForm = new MidpointForm(ID_MAIN_FORM);
    add(mainForm);
    MainObjectListPanel<ConnectorHostType> table = new MainObjectListPanel<ConnectorHostType>(ID_TABLE, ConnectorHostType.class, getQueryOptions()) {

        @Override
        protected void objectDetailsPerformed(AjaxRequestTarget target, ConnectorHostType host) {
        }

        @Override
        protected UserProfileStorage.TableId getTableId() {
            return UserProfileStorage.TableId.PAGE_RESOURCES_CONNECTOR_HOSTS;
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            return createRowActions();
        }

        @Override
        protected List<IColumn<SelectableBean<ConnectorHostType>, String>> createDefaultColumns() {
            return PageConnectorHosts.this.initColumns();
        }

        @Override
        protected boolean isCreateNewObjectEnabled() {
            return false;
        }

        @Override
        protected boolean isObjectDetailsEnabled(IModel<SelectableBean<ConnectorHostType>> rowModel) {
            return false;
        }
    };
    table.setOutputMarkupId(true);
    mainForm.add(table);
}
Also used : ConnectorHostType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) IModel(org.apache.wicket.model.IModel) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 42 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class ImportReportPopupPanel method initLayout.

protected void initLayout() {
    Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
    add(mainForm);
    FeedbackAlerts feedback = new FeedbackAlerts(ID_POPUP_FEEDBACK);
    feedback.setOutputMarkupId(true);
    mainForm.add(feedback);
    Model<String> nameModel = Model.of("");
    TextPanel nameField = new TextPanel(ID_NAME_FOR_DATA, nameModel);
    nameField.setOutputMarkupId(true);
    mainForm.add(nameField);
    Model<String> fileStringModel = Model.of("");
    TextAreaPanel fileStringField = new TextAreaPanel(ID_FILE_AS_NAME, fileStringModel, 5);
    fileStringField.setOutputMarkupId(true);
    mainForm.add(fileStringField);
    AjaxSubmitButton importButton = new AjaxSubmitButton(ID_IMPORT_BUTTON, createStringResource("PageReports.button.import")) {

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            importConfirmPerformed(target, nameModel, fileStringModel);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            FeedbackAlerts feedback = (FeedbackAlerts) getForm().get(ID_POPUP_FEEDBACK);
            target.add(feedback);
        }
    };
    mainForm.add(importButton);
    AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("userBrowserDialog.button.cancelButton")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            ImportReportPopupPanel.this.getPageBase().hideMainPopup(target);
        }
    };
    cancelButton.setOutputMarkupId(true);
    mainForm.add(cancelButton);
    FileUploadField choseFile = new FileUploadField(ID_CHOSE_FILE);
    mainForm.add(choseFile);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) FeedbackAlerts(com.evolveum.midpoint.web.component.message.FeedbackAlerts) TextPanel(com.evolveum.midpoint.web.component.input.TextPanel) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) TextAreaPanel(com.evolveum.midpoint.web.component.input.TextAreaPanel) FileUploadField(org.apache.wicket.markup.html.form.upload.FileUploadField)

Example 43 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class AbstractPageObjectDetails method createDetailsFragment.

protected DetailsFragment createDetailsFragment() {
    return new DetailsFragment(ID_DETAILS_VIEW, ID_DETAILS, AbstractPageObjectDetails.this) {

        @Override
        protected void initFragmentLayout() {
            add(initSummaryPanel());
            MidpointForm form = new MidpointForm(ID_MAIN_FORM);
            form.setMultiPart(true);
            add(form);
            initButtons(form);
            ContainerPanelConfigurationType defaultConfiguration = findDefaultConfiguration();
            initMainPanel(defaultConfiguration, form);
            form.add(initNavigation());
        }
    };
}
Also used : MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm)

Example 44 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class AbstractPageObjectDetails method replacePanel.

public void replacePanel(ContainerPanelConfigurationType config, AjaxRequestTarget target) {
    MidpointForm form = getMainForm();
    try {
        initMainPanel(config, form);
        target.add(form);
        target.add(getFeedbackPanel());
    } catch (Throwable e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Can't instantiate panel based on config\n {}", config.debugDump(), e);
        }
        error("Cannot instantiate panel, " + e.getMessage());
        target.add(getFeedbackPanel());
    }
}
Also used : MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm)

Example 45 with MidpointForm

use of com.evolveum.midpoint.web.component.form.MidpointForm in project midpoint by Evolveum.

the class InternalsTracesPanel method onInitialize.

protected void onInitialize() {
    super.onInitialize();
    setOutputMarkupId(true);
    Form form = new MidpointForm<>(ID_FORM);
    form.setOutputMarkupId(true);
    add(form);
    ListView<InternalOperationClasses> tracesTable = new ListView<InternalOperationClasses>(ID_TRACES_TABLE, Arrays.asList(InternalOperationClasses.values())) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem<InternalOperationClasses> item) {
            InternalOperationClasses operationClass = item.getModelObject();
            CheckFormGroup checkFormGroup = new CheckFormGroup(ID_TRACE_TOGGLE, new PropertyModel<>(tracesMap, operationClass.getKey()), createStringResource("InternalOperationClasses." + operationClass.getKey()), LABEL_SIZE, INPUT_SIZE);
            item.add(checkFormGroup);
        }
    };
    form.add(tracesTable);
    AjaxSubmitButton update = new AjaxSubmitButton(ID_UPDATE_TRACES, createStringResource("PageBase.button.update")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit(AjaxRequestTarget target) {
            updateTraces(target);
        }

        @Override
        protected void onError(AjaxRequestTarget target) {
            target.add(getPageBase().getFeedbackPanel());
        }
    };
    form.add(update);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) InternalOperationClasses(com.evolveum.midpoint.schema.internals.InternalOperationClasses) AjaxSubmitButton(com.evolveum.midpoint.web.component.AjaxSubmitButton) ListView(org.apache.wicket.markup.html.list.ListView) Form(org.apache.wicket.markup.html.form.Form) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) MidpointForm(com.evolveum.midpoint.web.component.form.MidpointForm) ListItem(org.apache.wicket.markup.html.list.ListItem) CheckFormGroup(com.evolveum.midpoint.web.component.form.CheckFormGroup)

Aggregations

MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)75 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)41 Form (org.apache.wicket.markup.html.form.Form)39 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)20 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)19 InlineMenuItem (com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)17 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)17 UserProfileStorage (com.evolveum.midpoint.web.session.UserProfileStorage)15 MainObjectListPanel (com.evolveum.midpoint.gui.api.component.MainObjectListPanel)14 ArrayList (java.util.ArrayList)14 Label (org.apache.wicket.markup.html.basic.Label)14 IModel (org.apache.wicket.model.IModel)14 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)11 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)9 ListItem (org.apache.wicket.markup.html.list.ListItem)8 SelectableBean (com.evolveum.midpoint.web.component.util.SelectableBean)7 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)7 List (java.util.List)7 OnChangeAjaxBehavior (org.apache.wicket.ajax.form.OnChangeAjaxBehavior)7 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)6