From 7b7d47a2bf3f6c7ee16db068f62cb2a0fe217938 Mon Sep 17 00:00:00 2001 From: Amanda <74random.amanda@gmail.com> Date: Thu, 10 Oct 2019 07:56:29 +0530 Subject: [PATCH] Fix delete - Fix delete button in UI - Close connection in DAO --- .../mgt/core/service/DeviceManagementProviderServiceImpl.java | 2 ++ .../devicemgt/app/pages/cdmf.page.devices/public/js/listing.js | 3 +++ 2 files changed, 5 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 1e3681ab91..3e452f2ee5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -605,6 +605,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv "' devices"; log.error(msg, e); throw new DeviceManagementException(msg, e); + } finally { + DeviceManagementDAOFactory.closeConnection(); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js index 09a515ac7d..498b65aaf0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js @@ -932,6 +932,9 @@ function attachDeviceEvents() { } } + $(modalPopupContent).html($('#delete-device-modal-content').html()); + showPopup(); + $("a#delete-device-yes-link").click(function () { deleteDevices(deviceIdentifiers); });