Search in sources :

Example 1 with AjaxLazyLoadPanel

use of org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel 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)

Aggregations

AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 Component (org.apache.wicket.Component)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 AjaxLazyLoadPanel (org.apache.wicket.extensions.ajax.markup.html.AjaxLazyLoadPanel)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 Label (org.apache.wicket.markup.html.basic.Label)1