From: John Alhroos Date: Wed, 12 May 2010 10:37:47 +0000 (+0000) Subject: Added test application and TB test for #4507 X-Git-Tag: 6.7.0.beta1~1670^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=359d4c5802c6dc5ebf1336e2823305f9674f89a0;p=vaadin-framework.git Added test application and TB test for #4507 svn changeset:13170/svn branch:6.3 --- diff --git a/tests/src/com/vaadin/tests/tickets/Ticket4507.html b/tests/src/com/vaadin/tests/tickets/Ticket4507.html new file mode 100644 index 0000000000..c4294bdce1 --- /dev/null +++ b/tests/src/com/vaadin/tests/tickets/Ticket4507.html @@ -0,0 +1,67 @@ + + + + + + +Ticket4507 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Ticket4507
open/vaadin63/run/com.vaadin.tests.tickets.Ticket4507?restartApplication
waitForVaadin
mouseClickvaadin=vaadin63runcomvaadinteststicketsTicket4507::/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0]5,9
waitForVaadin
screenCapture
mouseClickvaadin=vaadin63runcomvaadinteststicketsTicket4507::/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0]10,7
waitForVaadin
mouseClick//div[@id='vaadin63runcomvaadinteststicketsTicket4507-992355027']/div231,202
waitForVaadin
screenCapture
+ + diff --git a/tests/src/com/vaadin/tests/tickets/Ticket4507.java b/tests/src/com/vaadin/tests/tickets/Ticket4507.java new file mode 100644 index 0000000000..46ac4866de --- /dev/null +++ b/tests/src/com/vaadin/tests/tickets/Ticket4507.java @@ -0,0 +1,59 @@ +package com.vaadin.tests.tickets; + +import com.vaadin.Application; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.Table; +import com.vaadin.ui.Window; +import com.vaadin.ui.Button.ClickEvent; + +/** + * Setting table height and setting column header mode as hidden leaves the body + * height of the table as it would be with the headers visible and leaves an + * empty area below the body. + * + */ +@SuppressWarnings("serial") +public class Ticket4507 extends Application { + + @Override + public void init() { + Window mainWindow = new Window(); + setMainWindow(mainWindow); + + final Table table = new Table("Test table"); + table.addContainerProperty("Name", String.class, null, "Name", null, + null); + table.setItemCaptionPropertyId("Name"); + table.setHeight("100px"); + table.setImmediate(true); + + table.addItem("1").getItemProperty("Name").setValue("Item 1"); + table.addItem("2").getItemProperty("Name").setValue("Item 2"); + + CheckBox showHeaders = new CheckBox("Show headers", + new CheckBox.ClickListener() { + public void buttonClick(ClickEvent event) { + if (event.getButton().booleanValue()) { + // table body height is now 77px, which together + // with header makes 100px + table + .setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID); + } else { + table + .setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN); + // header disappears, but table body height stays at + // 77px + // and below the body is an empty area (same height + // as header would + // have) + + } + } + }); + showHeaders.setValue(true); + showHeaders.setImmediate(true); + + mainWindow.addComponent(showHeaders); + mainWindow.addComponent(table); + } +}