break;
}
break;
+ case Event.ONCONTEXTMENU:
+ if (client.hasEventListeners(VScrollTable.this,
+ HEADER_CLICK_EVENT_ID)) {
+ // Prevent showing the browser's context menu when there is
+ // a right click listener.
+ event.preventDefault();
+ }
+ break;
+ case Event.ONDBLCLICK:
+ fireHeaderClickedEvent(event);
+ break;
case Event.ONTOUCHMOVE:
case Event.ONMOUSEMOVE:
if (dragging) {
Paintable paintable = client.getPaintable(uidl);
paintable.updateFromUIDL(uidl, client);
}
+ pendingComponentPaints.clear();
}
}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">\r
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />\r
+<link rel="selenium.base" href="http://localhost:8888/" />\r
+<title>TextFieldValueGoesMissing</title>\r
+</head>\r
+<body>\r
+<table cellpadding="1" cellspacing="1" border="1">\r
+<thead>\r
+<tr><td rowspan="1" colspan="3">TextFieldValueGoesMissing</td></tr>\r
+</thead><tbody>\r
+<tr>\r
+ <td>open</td>\r
+ <td>/run/com.vaadin.tests.components.table.TextFieldValueGoesMissing?restartApplication</td>\r
+ <td></td>\r
+</tr>\r
+<tr>\r
+ <td>mouseClick</td>\r
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>\r
+ <td>73,10</td>\r
+</tr>\r
+<tr>\r
+ <td>enterCharacter</td>\r
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>\r
+ <td>test</td>\r
+</tr>\r
+<tr>\r
+ <td>click</td>\r
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>\r
+ <td></td>\r
+</tr>\r
+<tr>\r
+ <td>contextmenu</td>\r
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>\r
+ <td></td>\r
+</tr>\r
+<tr>\r
+ <td>assertValue</td>\r
+ <td>vaadin=runcomvaadintestscomponentstableTextFieldValueGoesMissing::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[2]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VTextField[0]</td>\r
+ <td>test</td>\r
+</tr>\r
+\r
+</tbody></table>\r
+</body>\r
+</html>\r
final Label label1 = new Label("1");
final Label label2 = new Label("2");
- Button button = new Button("Refresh");
+ Button button = new Button("Replace label");
button.addListener(new Button.ClickListener() {
public void buttonClick(ClickEvent event) {
- verticalLayout.replaceComponent(label1, label2);
+ if (verticalLayout.getComponentIndex(label1) > -1) {
+ verticalLayout.replaceComponent(label1, label2);
+ } else {
+ verticalLayout.replaceComponent(label2, label1);
+ }
}
});
verticalLayout.addComponent(button);
@Override
protected String getDescription() {
- return "Enter a text in the TextField in the table and press the 'replace label' button. This replaces the label which is in the same layout as the table but should not cause the TextField in the table to lose its contents";
+ return "Enter a text in the TextField in the table and press the 'Replace label' button. This replaces the label which is in the same layout as the table but should not cause the TextField in the table to lose its contents";
}
@Override