Kanagaraj M has uploaded a new change for review.

Change subject: webadmin: Fix Volume Dialog cluster validation issue
......................................................................

webadmin: Fix Volume Dialog cluster validation issue

Error message will be cleared if the user selects different
cluster. If the user changes the cluster before the call is
returned from backend, nothing will be done with the result
of the first call.

Change-Id: I457fe781fc4c54f2e705d1c0febfc73ccb2ab2ff
Bug-Url: https://bugzilla.redhat.com/883774
Signed-off-by: Kanagaraj M <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/44/10744/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
index d9cd9e9..0a7e994 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeModel.java
@@ -421,18 +421,23 @@
     private void clusterSelectedItemChanged()
     {
         setBricks(new ListModel());
-        setMessage(null);
 
         if (getCluster().getSelectedItem() != null)
         {
-            VDSGroup cluster = (VDSGroup) getCluster().getSelectedItem();
+            final VDSGroup cluster = (VDSGroup) getCluster().getSelectedItem();
             AsyncDataProvider.GetHostListByCluster(new AsyncQuery(this, new 
INewAsyncCallback() {
                 @Override
                 public void OnSuccess(Object model, Object returnValue) {
+                    // In case the result of previous call is returned after 
selecting some other cluster
+                    if (!((VDSGroup) 
getCluster().getSelectedItem()).getId().equals(cluster.getId())) {
+                        return;
+                    }
+
                     List<VDS> hostList = (List<VDS>) returnValue;
                     for (VDS host : hostList) {
                         if (host.getstatus() == VDSStatus.Up) {
                             getAddBricksCommand().setIsExecutionAllowed(true);
+                            setMessage(null);
                             return;
                         }
                     }
@@ -444,6 +449,7 @@
         else
         {
             getAddBricksCommand().setIsExecutionAllowed(false);
+            setMessage(null);
         }
     }
 


--
To view, visit http://gerrit.ovirt.org/10744
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I457fe781fc4c54f2e705d1c0febfc73ccb2ab2ff
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Kanagaraj M <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to