Alona Kaplan has uploaded a new change for review.

Change subject: webadmin: Create new VM | Not all selected nics are created on 
the VM
......................................................................

webadmin: Create new VM | Not all selected nics are created on the VM

Opening and closing ghost profile instance type editor without selecting a
value causes the first acceptable value to be displayed at the header text
box (just to be displayed, not really be selected-> the real value is
still null).

It is caused because ListModelTypeAheadListBox->adjustSelectedValue()
calls in the described case-
'setValue(acceptableValues.iterator().next())' without firing valueChange
event. The displayed value is changed, but the model.selectedValue is
still null.

Calling setValue with 'true' for 'fireValueChangeEvent' fixes the issue.

But, as I understand, if the the selected value ('getValue()') was 'null'
and wasn't changed manually to another value.
There is no reason to override it here by the first item in the list.

Change-Id: Iaa8ec33db813f334f07baadac38f27c5544f0791
Bug-Url: https://bugzilla.redhat.com/1115788
Signed-off-by: Alona Kaplan <[email protected]>
(cherry picked from commit 27b97db8ba54239eb7a01477fea4e499df1ba395)
---
M 
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.java
1 file changed, 13 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/17/30517/1

diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.java
 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.java
index c669296..0ca6db9 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.java
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/editor/ListModelTypeAheadListBox.java
@@ -1,28 +1,28 @@
 package org.ovirt.engine.ui.common.widget.editor;
 
-import com.google.gwt.core.client.Scheduler;
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.event.dom.client.FocusHandler;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseUpEvent;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.logical.shared.ValueChangeEvent;
-import com.google.gwt.event.logical.shared.ValueChangeHandler;
-import com.google.gwt.user.client.ui.MenuBar;
-import com.google.gwt.user.client.ui.MenuItem;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+
 import 
org.ovirt.engine.ui.common.widget.editor.ListModelTypeAheadListBoxEditor.SuggestBoxRenderer;
+
 import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.NativeEvent;
 import com.google.gwt.event.dom.client.BlurEvent;
 import com.google.gwt.event.dom.client.BlurHandler;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.FocusHandler;
 import com.google.gwt.event.dom.client.KeyCodes;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.MouseUpEvent;
+import com.google.gwt.event.dom.client.MouseUpHandler;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
 import com.google.gwt.event.shared.HandlerRegistration;
 import com.google.gwt.resources.client.CssResource;
 import com.google.gwt.uibinder.client.UiBinder;
@@ -32,6 +32,8 @@
 import com.google.gwt.user.client.Event.NativePreviewHandler;
 import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.MenuBar;
+import com.google.gwt.user.client.ui.MenuItem;
 import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
 import 
com.google.gwt.user.client.ui.MultiWordSuggestOracle.MultiWordSuggestion;
 import com.google.gwt.user.client.ui.SuggestBox;
@@ -240,9 +242,6 @@
             if (getValue() != null) {
                 // something has been there, deleted on click inside and than 
hidden the box - restoring
                 
asSuggestBox().setText(renderer.getReplacementString(getValue()));
-            } else if (!acceptableValues.contains(null)) {
-                // nothing has been there, selecting the first accpetable value
-                setValue(acceptableValues.iterator().next());
             }
         } else {
             // something has been typed inside - validate


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

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

Reply via email to