소스 검색

#7536 combobox search result does not get cleared when added to a popup window

svn changeset:20841/svn branch:6.6
tags/6.7.0.rc1
Leif Åstrand 12 년 전
부모
커밋
3a3f8cb01b

+ 6
- 0
src/com/vaadin/terminal/gwt/client/ui/VFilterSelect.java 파일 보기

@@ -1733,4 +1733,10 @@ public class VFilterSelect extends Composite implements Paintable, Field,
}
}
}

@Override
protected void onDetach() {
super.onDetach();
suggestionPopup.hide();
}
}

+ 31
- 0
tests/src/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.html 파일 보기

@@ -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&amp;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>

+ 42
- 0
tests/src/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java 파일 보기

@@ -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);
}

}

Loading…
취소
저장