Search in sources :

Example 6 with AjaxChannel

use of org.apache.wicket.ajax.AjaxChannel in project midpoint by Evolveum.

the class NavigatorPanel method initLast.

private void initLast() {
    WebMarkupContainer last = new WebMarkupContainer(ID_LAST);
    last.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return isLastEnabled() ? "" : "disabled";
        }
    }));
    add(last);
    AjaxLink lastLink = new AjaxLink(ID_LAST_LINK) {

        @Override
        protected void updateAjaxAttributes(AjaxRequestAttributes attributes) {
            attributes.setChannel(new AjaxChannel("blocking", AjaxChannel.Type.ACTIVE));
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            lastPerformed(target);
        }
    };
    lastLink.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isEnabled() {
            return BooleanUtils.isTrue(showPageListingModel.getObject()) && isLastEnabled();
        }
    });
    last.add(lastLink);
}
Also used : AjaxRequestAttributes(org.apache.wicket.ajax.attributes.AjaxRequestAttributes) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) AjaxChannel(org.apache.wicket.ajax.AjaxChannel) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) AttributeModifier(org.apache.wicket.AttributeModifier) AjaxLink(org.apache.wicket.ajax.markup.html.AjaxLink) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)6 AjaxChannel (org.apache.wicket.ajax.AjaxChannel)6 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)6 AjaxRequestAttributes (org.apache.wicket.ajax.attributes.AjaxRequestAttributes)6 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)5 AttributeModifier (org.apache.wicket.AttributeModifier)4 AjaxLink (org.apache.wicket.ajax.markup.html.AjaxLink)4 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)4 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)2 Label (org.apache.wicket.markup.html.basic.Label)2 AssignmentEditorDto (com.evolveum.midpoint.web.component.assignment.AssignmentEditorDto)1 PageAssignmentShoppingKart (com.evolveum.midpoint.web.page.self.PageAssignmentShoppingKart)1 RoleCatalogStorage (com.evolveum.midpoint.web.session.RoleCatalogStorage)1 SessionStorage (com.evolveum.midpoint.web.session.SessionStorage)1