From 3c8c823f48117bcd29f91ee21e27f712eb8bef29 Mon Sep 17 00:00:00 2001 From: Norbert Csaba Herczeg Date: Wed, 12 Jun 2024 13:15:16 +0200 Subject: [PATCH] JNG-5761-fix association table edit mode --- .../judo/ui/generator/react/UiWidgetHelper.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiWidgetHelper.java b/judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiWidgetHelper.java index aada7c21..4b2bc8f0 100644 --- a/judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiWidgetHelper.java +++ b/judo-ui-react/src/main/java/hu/blackbelt/judo/ui/generator/react/UiWidgetHelper.java @@ -341,8 +341,13 @@ public static String tableButtonVisibilityConditions(Button button, Table table, if (button.getActionDefinition().getIsOpenCreateFormAction() && !table.isIsEager() && container.isView()) { return "!editMode && (isFormUpdateable ? isFormUpdateable() : false)"; } - if (button.getActionDefinition().getIsOpenSelectorAction() && container.isView()) { - return "(isFormUpdateable ? isFormUpdateable() : false)"; + if (container.isView()) { + if (button.getActionDefinition().getIsOpenSelectorAction() || button.getActionDefinition().getIsRemoveAction()) { + return "(isFormUpdateable ? (isFormUpdateable()" + (!table.isIsEager() ? "&& !editMode" : "") + ") : false)"; + } + if (button.getActionDefinition().getIsBulkRemoveAction() || button.getActionDefinition().getIsClearAction()) { + return "(isFormUpdateable ? (isFormUpdateable()" + (!table.isIsEager() ? "&& !editMode" : "") + " && selectionModel.length > 0) : false)"; + } } if (button.getActionDefinition().getIsClearAction()) { String result = "data.length > 0";