From e4702bdae9f0618eab30f07ba5f7ab814cc08806 Mon Sep 17 00:00:00 2001 From: Khurshid Fayzullaev Date: Tue, 8 Apr 2014 16:48:32 -0400 Subject: Prevent adding devices with the equal Unique IDs --- src/org/traccar/web/client/controller/DeviceController.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/org') diff --git a/src/org/traccar/web/client/controller/DeviceController.java b/src/org/traccar/web/client/controller/DeviceController.java index 94c81ed3..95eb60d7 100644 --- a/src/org/traccar/web/client/controller/DeviceController.java +++ b/src/org/traccar/web/client/controller/DeviceController.java @@ -84,6 +84,10 @@ public class DeviceController implements ContentController, DeviceView.DeviceHan public void onSuccess(Device result) { deviceStore.add(result); } + @Override + public void onFailure(Throwable caught) { + new AlertMessageBox("Error", "Device with this Unique ID already exists").show(); + } }); } }).show(); @@ -99,6 +103,10 @@ public class DeviceController implements ContentController, DeviceView.DeviceHan public void onSuccess(Device result) { deviceStore.update(result); } + @Override + public void onFailure(Throwable caught) { + new AlertMessageBox("Error", "Device with this Unique ID already exists").show(); + } }); } }).show(); -- cgit v1.2.3