mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 20:28:00 +08:00
PL-8610 Close standard Remove Confirmation dialog if delete has failed because of deletion policy
This commit is contained in:
parent
d504b51a88
commit
6cc99b5932
@ -219,7 +219,17 @@ public class RemoveAction extends ItemTrackingAction implements Action.HasBefore
|
||||
new DialogAction(Type.OK, Status.PRIMARY) {
|
||||
@Override
|
||||
public void actionPerform(Component component) {
|
||||
try {
|
||||
remove(selected);
|
||||
} finally {
|
||||
target.requestFocus();
|
||||
try {
|
||||
//noinspection unchecked
|
||||
target.setSelected(selected);
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new DialogAction(Type.CANCEL) {
|
||||
|
@ -1262,8 +1262,11 @@ public class WebWindowManager extends WindowManager {
|
||||
Button button = WebComponentsHelper.createButton();
|
||||
button.setCaption(action.getCaption());
|
||||
button.addClickListener(event -> {
|
||||
try {
|
||||
action.actionPerform(null);
|
||||
} finally {
|
||||
ui.removeWindow(window);
|
||||
}
|
||||
});
|
||||
|
||||
if (StringUtils.isNotEmpty(action.getIcon())) {
|
||||
|
Loading…
Reference in New Issue
Block a user