PDA

View Full Version : [FIXED] Beta5 & RC1: MessageBox causes Table column resize to freeze



andrey
20 Jun 2008, 10:04 AM
Took me a long time to isolate this problem, but I think I've found it. My apologies that my JS/CSS skills are not good enough to debug it past isolating it down to some demonstrable code.

Using the test code below, do the following:
Push the button so that the MessageBox.alert() shows up
Dismiss the message box
Try resizing the columns by dragging on the splitter between the column headingsWith the beta4 gxt.jar, the column resize will work. However, with the beta5 and rc1 gxt.jar, the column splitter bar separates from the column heading splitter and gets confused (try it).



import java.util.ArrayList;
import java.util.List;

import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.extjs.gxt.ui.client.widget.Viewport;
import com.extjs.gxt.ui.client.widget.button.ButtonBar;
import com.extjs.gxt.ui.client.widget.button.ToggleButton;
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.table.Table;
import com.extjs.gxt.ui.client.widget.table.TableColumn;
import com.extjs.gxt.ui.client.widget.table.TableColumnModel;
import com.extjs.gxt.ui.client.widget.table.TableItem;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class TestColumnResizeAfterAlert implements EntryPoint {
public void onModuleLoad() {
ContentPanel mainPanel = new ContentPanel();

ButtonBar dummyBar = new ButtonBar();
ToggleButton dummy = new ToggleButton("Show Alert");
dummy.addSelectionListener(new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
MessageBox.alert("Alert", "Now try re-sizing the table columns", null);
}
});
dummyBar.add(dummy);
mainPanel.add(dummyBar);

List<TableColumn> columns = new ArrayList<TableColumn>();
TableColumn column = new TableColumn("Col1", 100);
columns.add(column);

TableColumn column2 = new TableColumn("Col2", 200);
columns.add(column2);

TableColumnModel cm = new TableColumnModel(columns);
Table table = new Table(cm);

for(int i = 0; i < 3; ++i) {
Object[] values = { "c1." + i, "c2." + i };
table.add(new TableItem(values));
}

mainPanel.add(table);

Viewport vp = new Viewport();
vp.setLayout(new FitLayout());
vp.add(mainPanel);

RootPanel.get().add(vp);
}
}
A screenshot showing the splitter bar in this funky mode is attached.

Thanks,
Andre

gslender
20 Jun 2008, 2:27 PM
Make sure you are using the following doctype in your HTML...

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

andrey
20 Jun 2008, 8:53 PM
Thanks for the suggestion, but I tried that and if you follow the steps outlined earlier, it the column resizing still gets corrupted. Here's the Test.html I'm now using:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Wrapper HTML for Test</title>
<link rel="stylesheet" type="text/css" href="css/ext-all.css" />
<script language='javascript' src='com.act3.test.Test.nocache.js'></script>
</head>

<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
<div id="slot1" />
</body>
</html>

darrellmeyer
22 Jun 2008, 6:49 AM
Thank you for the test code. The fix is in SVN.