Search in sources :

Example 96 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class TestConnectionResultPanel method initLayout.

private void initLayout(Page parentPage) {
    WebMarkupContainer contentPanel = new WebMarkupContainer(ID_CONTENT_PANEL);
    contentPanel.setOutputMarkupId(true);
    add(contentPanel);
    Label messageLabel = new Label(ID_MESSAGE, ((PageBase) parentPage).createStringResource("TestConnectionResultPanel.message"));
    messageLabel.setOutputMarkupId(true);
    contentPanel.add(messageLabel);
    messageLabel.add(new VisibleEnableBehaviour() {

        public boolean isVisible() {
            return !isLoaded;
        }
    });
    AjaxLazyLoadPanel resultsPanel = new AjaxLazyLoadPanel(ID_RESULT) {

        @Override
        public Component getLazyLoadComponent(String id) {
            return new TestConnectionMessagesPanel(id, resourceOid, (PageBase) parentPage);
        }

        @Override
        protected void onComponentLoaded(Component component, AjaxRequestTarget target) {
            isLoaded = true;
            target.add(component);
            target.add(messageLabel);
        }
    };
    contentPanel.add(resultsPanel);
    AjaxButton ok = new AjaxButton(ID_OK) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            getPageBase().hideMainPopup(target);
            okPerformed(target);
        }
    };
    contentPanel.add(ok);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) Label(org.apache.wicket.markup.html.basic.Label) AjaxLazyLoadPanel(org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) Component(org.apache.wicket.Component) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 97 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class PageAccount method initLayout.

private void initLayout() {
    Form mainForm = new Form("mainForm");
    mainForm.setMultiPart(true);
    add(mainForm);
    WebMarkupContainer protectedMessage = new WebMarkupContainer(ID_PROTECTED_MESSAGE);
    protectedMessage.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            ObjectWrapper wrapper = accountModel.getObject();
            return wrapper.isProtectedAccount();
        }
    });
    mainForm.add(protectedMessage);
    PrismObjectPanel<ShadowType> userForm = new PrismObjectPanel<ShadowType>("account", accountModel, new PackageResourceReference(ImgResources.class, ImgResources.HDD_PRISM), mainForm, this);
    mainForm.add(userForm);
    initButtons(mainForm);
}
Also used : ImgResources(com.evolveum.midpoint.web.resource.img.ImgResources) Form(org.apache.wicket.markup.html.form.Form) PackageResourceReference(org.apache.wicket.request.resource.PackageResourceReference) ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) ObjectWrapper(com.evolveum.midpoint.web.component.prism.ObjectWrapper) PrismObjectPanel(com.evolveum.midpoint.web.component.prism.PrismObjectPanel) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 98 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class AssignmentEditorPanel method showEmptyPerformed.

private void showEmptyPerformed(AjaxRequestTarget target) {
    AssignmentEditorDto dto = AssignmentEditorPanel.this.getModel().getObject();
    dto.setShowEmpty(!dto.isShowEmpty());
    WebMarkupContainer parent = (WebMarkupContainer) get(createComponentPath(ID_BODY, ID_CONSTRUCTION_CONTAINER));
    target.add(parent.get(ID_ATTRIBUTES), parent.get(createComponentPath(ID_SHOW_EMPTY, ID_SHOW_EMPTY_LABEL)), getPageBase().getFeedbackPanel());
}
Also used : WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 99 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class LockoutStatusPanel method initLayout.

private void initLayout(final IModel<LockoutStatusType> model) {
    WebMarkupContainer container = new WebMarkupContainer(ID_CONTAINER);
    add(container);
    Label label = new Label(ID_LABEL, new IModel<String>() {

        @Override
        public String getObject() {
            LockoutStatusType object = model != null ? model.getObject() : null;
            String labelValue = object == null ? ((PageBase) getPage()).createStringResource("LockoutStatusType.UNDEFINED").getString() : WebComponentUtil.createLocalizedModelForEnum(object, getLabel()).getObject();
            if (!isInitialState) {
                labelValue += " " + ((PageBase) getPage()).createStringResource("LockoutStatusPanel.changesSaving").getString();
            }
            return labelValue;
        }

        @Override
        public void setObject(String s) {
        }

        @Override
        public void detach() {
        }
    });
    label.setOutputMarkupId(true);
    container.add(label);
    AjaxButton button = new AjaxButton(ID_BUTTON, getButtonModel()) {

        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            PrismPropertyValue oldValue = (PrismPropertyValue) valueWrapper.getOldValue();
            if (!isInitialState) {
                model.setObject(initialValue);
                oldValue.setValue(initialValue);
                valueWrapper.setStatus(ValueStatus.NOT_CHANGED);
            } else {
                model.setObject(LockoutStatusType.NORMAL);
                if (oldValue.getValue() != null) {
                    oldValue.setValue(null);
                }
            }
            isInitialState = !isInitialState;
            ajaxRequestTarget.add(getButton());
            ajaxRequestTarget.add(getLabel());
        }
    };
    button.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return true;
        }
    });
    button.setOutputMarkupId(true);
    container.add(button);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Label(org.apache.wicket.markup.html.basic.Label) LockoutStatusType(com.evolveum.midpoint.xml.ns._public.common.common_3.LockoutStatusType) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) PageBase(com.evolveum.midpoint.gui.api.page.PageBase) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) PrismPropertyValue(com.evolveum.midpoint.prism.PrismPropertyValue)

Example 100 with WebMarkupContainer

use of org.apache.wicket.markup.html.WebMarkupContainer in project midpoint by Evolveum.

the class AssignmentCatalogPanel method initLayout.

private void initLayout() {
    initModels();
    initProvider();
    setOutputMarkupId(true);
    initHeaderPanel();
    WebMarkupContainer panelContainer = new WebMarkupContainer(ID_CATALOG_ITEMS_PANEL_CONTAINER);
    panelContainer.setOutputMarkupId(true);
    add(panelContainer);
    addOrReplaceLayout(null, panelContainer);
}
Also used : WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)224 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)103 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)101 Label (org.apache.wicket.markup.html.basic.Label)95 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)57 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)44 List (java.util.List)41 ListItem (org.apache.wicket.markup.html.list.ListItem)41 ArrayList (java.util.ArrayList)39 ListView (org.apache.wicket.markup.html.list.ListView)37 PropertyModel (org.apache.wicket.model.PropertyModel)34 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)26 TextField (org.apache.wicket.markup.html.form.TextField)25 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)21 AttributeModifier (org.apache.wicket.AttributeModifier)21 Form (org.apache.wicket.markup.html.form.Form)21 IModel (org.apache.wicket.model.IModel)21 Model (org.apache.wicket.model.Model)18 AjaxFormComponentUpdatingBehavior (org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior)17 InfoTooltipBehavior (com.evolveum.midpoint.web.util.InfoTooltipBehavior)16