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

(cherry picked from commit 5550a01)
  • Loading branch information
1azyman committed Dec 15, 2023
1 parent 3f30a95 commit 36e1963
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
*/
package com.evolveum.midpoint.gui.impl.page.admin.component;

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 @@ -175,9 +177,8 @@ protected void onError(AjaxRequestTarget target) {
target.add(getPageBase().getFeedbackPanel());
}
};
// Probably won't work correctly, will be overridden with visible behavior default value for enabled.
save.add(new EnableBehaviour(this::isSavePreviewButtonEnabled));
save.add(new VisibleBehaviour(this::isSaveButtonVisible));

save.add(new VisibleEnableBehaviour(this::isSaveButtonVisible, this::isSavePreviewButtonEnabled));
save.titleAsLabel(true);
save.setOutputMarkupId(true);
save.add(AttributeAppender.append("class", "btn btn-success btn-sm"));
Expand Down

0 comments on commit 36e1963

Please sign in to comment.