Tomas Jelinek has uploaded a new change for review.

Change subject: userportal: VMs are not refreshed after edit
......................................................................

userportal: VMs are not refreshed after edit

In PUP: edit VM, click OK, edit VM again

The values will still be the old ones and you need
to wait until the next refresh cycle to actually
get them refreshed.

The refreshing after edit works like this:
When the popup is closed (the window model is set
to null), the ModelBoundPopupHandler
catches this event and calls the hideAndClearPopup
which calls the force refresh. This ensures,
that after the values are edited, the screen
contains the updated data.

The problem was, that the UserPortalListModel
called the cancel() method right after the
command to update the values has been sent to the server.
Before the call returned, the force refresh
tried to get the updated data, but they
was not necessarily updated yet.

Changed to call the cancel() after the
specific commands returns to ensure that the
data are actually modified.

Change-Id: If37dfffaafd72e385dfed03b3aafbd07cd82ba2d
Bug-Url: https://bugzilla.redhat.com/864059
Signed-off-by: Tomas Jelinek <tjeli...@redhat.com>
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
2 files changed, 6 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/10/8610/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
index 06fdfb5..a15fa77 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/userportal/UserPortalListModel.java
@@ -1226,7 +1226,6 @@
                     public void OnSuccess(Object target, Object returnValue) {
 
                         UserPortalListModel userPortalListModel = 
(UserPortalListModel) target;
-                        stopProgress(target);
                         boolean isNameUnique = (Boolean) returnValue;
                         String newName = (String) model.getName().getEntity();
                         String currentName = 
userPortalListModel.gettempVm().getvm_name();
@@ -1241,6 +1240,7 @@
                             unitModel.getName().setIsValid(false);
                             unitModel.setIsValid(false);
                             unitModel.setIsGeneralTabValid(false);
+                            stopProgress(target);
                         }
                         else
                         {
@@ -1337,7 +1337,6 @@
             
gettempVm().setMigrationSupport(MigrationSupport.IMPLICITLY_NON_MIGRATABLE);
         }
 
-        boolean cancel = true;
         if (model.getIsNew())
         {
             if (gettempVm().getvmt_guid().equals(NGuid.Empty))
@@ -1353,6 +1352,7 @@
                             @Override
                             public void Executed(FrontendActionAsyncResult 
result) {
                                 stopProgress(result.getState());
+                                cancel();
                             }
                         }, this);
             }
@@ -1409,16 +1409,13 @@
                                         @Override
                                         public void 
Executed(FrontendMultipleActionAsyncResult a) {
                                             stopProgress(a.getState());
+                                            cancel();
                                         }
                                     },
                                     this);
-
-                            userPortalListModel1.cancel();
-
                         }
                     };
                     AsyncDataProvider.GetTemplateDiskList(_asyncQuery, 
template.getId());
-                    cancel = false;
                 }
                 else
                 {
@@ -1433,6 +1430,7 @@
                                 @Override
                                 public void 
Executed(FrontendMultipleActionAsyncResult a) {
                                     stopProgress(a.getState());
+                                    cancel();
                                 }
                             },
                             this);
@@ -1455,6 +1453,7 @@
                                             @Override
                                             public void 
Executed(FrontendActionAsyncResult a) {
                                                 stopProgress(a.getState());
+                                                cancel();
                                             }
                                         }, this);
 
@@ -1468,14 +1467,10 @@
                             @Override
                             public void Executed(FrontendActionAsyncResult a) {
                                 stopProgress(a.getState());
+                                cancel();
                             }
                         }, this);
             }
-        }
-
-        if (cancel)
-        {
-            cancel();
         }
     }
 
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
index 1342754..31ce703 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/vms/VmListModel.java
@@ -857,19 +857,6 @@
 
         model.Initialize(this.getSystemTreeSelectedItem());
 
-        // TODO:
-        // VDSGroup cluster = null;
-        // if (model.Cluster.Items == null)
-        // {
-        // model.Commands.Add(
-        // new UICommand("Cancel", this)
-        // {
-        // Title = "Cancel",
-        // IsCancel = true
-        // });
-        // return;
-        // }
-
         UICommand tempVar = new UICommand("OnSave", this); //$NON-NLS-1$
         tempVar.setTitle(ConstantsManager.getInstance().getConstants().ok());
         tempVar.setIsDefault(true);


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If37dfffaafd72e385dfed03b3aafbd07cd82ba2d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjeli...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to