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 From 37e994bafc08c1a54a4b996d4b1d568ff09f89be Mon Sep 17 00:00:00 2001 From: Khurshid Fayzullaev Date: Tue, 8 Apr 2014 19:28:30 -0400 Subject: Update DeviceController.java --- src/org/traccar/web/client/controller/DeviceController.java | 1 + 1 file changed, 1 insertion(+) (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 95eb60d7..b884537b 100644 --- a/src/org/traccar/web/client/controller/DeviceController.java +++ b/src/org/traccar/web/client/controller/DeviceController.java @@ -28,6 +28,7 @@ import com.google.gwt.core.client.GWT; import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.widget.core.client.ContentPanel; import com.sencha.gxt.widget.core.client.Dialog.PredefinedButton; +import com.sencha.gxt.widget.core.client.box.AlertMessageBox; import com.sencha.gxt.widget.core.client.box.ConfirmMessageBox; import com.sencha.gxt.widget.core.client.event.HideEvent; -- cgit v1.2.3