svn changeset:20841/svn branch:6.6tags/6.7.0.rc1
@@ -1733,4 +1733,10 @@ public class VFilterSelect extends Composite implements Paintable, Field, | |||
} | |||
} | |||
} | |||
@Override | |||
protected void onDetach() { | |||
super.onDetach(); | |||
suggestionPopup.hide(); | |||
} | |||
} |
@@ -0,0 +1,31 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |||
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> | |||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |||
<link rel="selenium.base" href="" /> | |||
<title>New Test</title> | |||
</head> | |||
<body> | |||
<table cellpadding="1" cellspacing="1" border="1"> | |||
<thead> | |||
<tr><td rowspan="1" colspan="3">New Test</td></tr> | |||
</thead><tbody> | |||
<tr> | |||
<td>open</td> | |||
<td>/run/com.vaadin.tests.components.combobox.ComboBoxSuggestionOnDetach?restartApplication&debug</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td>mouseClick</td> | |||
<td>vaadin=runcomvaadintestscomponentscomboboxComboBoxSuggestionOnDetach::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VFilterSelect[0]/domChild[1]</td> | |||
<td>11,12</td> | |||
</tr> | |||
<tr> | |||
<td>assertElementNotPresent</td> | |||
<td>vaadin=runcomvaadintestscomponentscomboboxComboBoxSuggestionOnDetach::Root/VFilterSelect$SuggestionPopup[0]</td> | |||
<td></td> | |||
</tr> | |||
</tbody></table> | |||
</body> | |||
</html> |
@@ -0,0 +1,42 @@ | |||
package com.vaadin.tests.components.combobox; | |||
import java.util.Arrays; | |||
import com.vaadin.event.FieldEvents; | |||
import com.vaadin.event.FieldEvents.FocusEvent; | |||
import com.vaadin.tests.components.TestBase; | |||
import com.vaadin.ui.ComboBox; | |||
import com.vaadin.ui.Window; | |||
public class ComboBoxSuggestionOnDetach extends TestBase { | |||
@Override | |||
protected void setup() { | |||
final Window popup = new Window(); | |||
ComboBox comboBox = new ComboBox("Combo box", Arrays.asList("Option 1", | |||
"Option 2", "Option 3")); | |||
comboBox.addListener(new FieldEvents.FocusListener() { | |||
public void focus(FocusEvent event) { | |||
popup.getParent().removeWindow(popup); | |||
} | |||
}); | |||
popup.addComponent(comboBox); | |||
popup.setSizeUndefined(); | |||
popup.getContent().setSizeUndefined(); | |||
popup.center(); | |||
getMainWindow().addWindow(popup); | |||
} | |||
@Override | |||
protected String getDescription() { | |||
return "Click the arrow to open the combo box suggestion list. When the box is focused, the window is closed and the suggestion popup of the combo box should also be closed"; | |||
} | |||
@Override | |||
protected Integer getTicketNumber() { | |||
return Integer.valueOf(7536); | |||
} | |||
} |