Ramesh N has uploaded a new change for review.

Change subject: webadmin: fix sub-tabs loading issue in volumes tab
......................................................................

webadmin: fix sub-tabs loading issue in volumes tab

  Bricks, Options and Permission sub tabs of Volume tab are
in loading state always when user tries to logout when any of
these sub tabs are active and go back to the same sub tab again
immeditaly after login.

  Fixed it by adding syncSearch() in all these List Models

Change-Id: I1051df9da2233723894a931c981688dfab9478c3
Bug-Url: https://bugzilla.redhat.com/1012871
Signed-off-by: Ramesh Nachimuthu <[email protected]>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeParameterListModel.java
2 files changed, 41 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/49/21449/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
index 953309a..dff6b89 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeBrickListModel.java
@@ -37,6 +37,7 @@
 import org.ovirt.engine.ui.uicommonweb.models.SearchableListModel;
 import org.ovirt.engine.ui.uicommonweb.models.volumes.VolumeListModel;
 import org.ovirt.engine.ui.uicompat.ConstantsManager;
+import org.ovirt.engine.ui.uicompat.EventArgs;
 import org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult;
 import org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback;
 
@@ -260,9 +261,31 @@
     @Override
     protected void onEntityChanged() {
         super.onEntityChanged();
+        getSearchCommand().execute();
+    }
+
+    @Override
+    public void search()
+    {
+        if (getEntity() != null)
+        {
+            super.search();
+        }
+    }
+
+    @Override
+    protected void syncSearch() {
+        if (getEntity() == null) {
+            return;
+        }
         if (getEntity() != null) {
             GlusterVolumeEntity glusterVolumeEntity = (GlusterVolumeEntity) 
getEntity();
-            setItems(glusterVolumeEntity.getBricks());
+            // If the items are same, just fire the item changed event to make 
sure that items are displayed
+            if (getItems() == glusterVolumeEntity.getBricks()) {
+                getItemsChangedEvent().raise(this, EventArgs.Empty);
+            } else {
+                setItems(glusterVolumeEntity.getBricks());
+            }
         }
         else {
             setItems(null);
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeParameterListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeParameterListModel.java
index 94611ea..e4347b6 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeParameterListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/VolumeParameterListModel.java
@@ -397,16 +397,32 @@
 
     @Override
     protected void onEntityChanged() {
+        super.onEntityChanged();
+        getSearchCommand().execute();
+    }
+
+    @Override
+    public void search()
+    {
+        if (getEntity() != null)
+        {
+            super.search();
+        }
+    }
+
+    @Override
+    protected void syncSearch()
+    {
         if (getEntity() == null) {
             return;
         }
-        super.onEntityChanged();
         GlusterVolumeEntity glusterVolumeEntity = (GlusterVolumeEntity) 
getEntity();
         ArrayList<GlusterVolumeOptionEntity> list = new 
ArrayList<GlusterVolumeOptionEntity>();
         for (GlusterVolumeOptionEntity glusterVolumeOption : 
glusterVolumeEntity.getOptions()) {
             list.add(glusterVolumeOption);
         }
         setItems(list);
+
     }
 
     @Override


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

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

Reply via email to