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 674b7d7 commit 5550a01
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.AttributeModifier;
import org.apache.wicket.Component;
Expand Down Expand Up @@ -210,9 +212,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 5550a01

Please sign in to comment.