Skip to content

Commit

Permalink
MID-9355 save button visible/enable behaviour not handled correctly -…
Browse files Browse the repository at this point in the history
… fixed
  • Loading branch information
1azyman committed Dec 15, 2023
1 parent 71d983b commit ffedcac
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel;

import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;

import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
Expand Down Expand Up @@ -174,8 +176,20 @@ protected void onError(AjaxRequestTarget target) {
target.add(getPageBase().getFeedbackPanel());
}
};
save.add(new EnableBehaviour(this::isSavePreviewButtonEnabled));
save.add(new VisibleBehaviour(this::isSaveButtonVisible));
// save.add(new EnableBehaviour(this::isSavePreviewButtonEnabled));
// save.add(new VisibleBehaviour(this::isSaveButtonVisible));
save.add(new VisibleEnableBehaviour() {

@Override
public boolean isVisible() {
return isSaveButtonVisible();
}

@Override
public boolean isEnabled() {
return isSavePreviewButtonEnabled();
}
});
save.titleAsLabel(true);
save.setOutputMarkupId(true);
save.add(AttributeAppender.append("class", "btn btn-success btn-sm"));
Expand Down

0 comments on commit ffedcac

Please sign in to comment.