PDA

View Full Version : [FIXED] [2.0.1] TreeGrid scrollbar bug blocks text entry in windows



silv
23 Jul 2009, 6:03 AM
Sorry for the strange title, not sure how to explain this better. I have included some sample code below, which is based on the Re-ordering treegrid to illustrate the bug. I'm testing on Safari 4. (GXT 2.0.1, GWT 1.7)

Steps to reproduce:

1. Ensure the TreeGrid has scrollbars.
2. Click on a button to make a Window pop up.
3. Enter text in the textbox and click OK.
4. Drag the scrollbar around.
5. Click on a button to make a Window pop up.
6. Attempt to enter text, it won't work.

Essentially after you scroll around, the Window text boxes lock and you can't enter any more data.



public class Samplebug implements EntryPoint {


public void onModuleLoad() {

Viewport v = new Viewport();
v.setLayout(new FitLayout());

Folder model = TestData.getTreeModel();

TreeStore<ModelData> store = new TreeStore<ModelData>();
store.add(model.getChildren(), true);

ColumnConfig name = new ColumnConfig("name", "Name", 300);
name.setRenderer(new WidgetTreeGridCellRenderer<ModelData>(){
@Override
public Widget getWidget(ModelData model, String property, ColumnData config, int rowIndex, int colIndex,
ListStore<ModelData> store, Grid<ModelData> grid) {
return new Button((String)model.get(property), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
final Window w = new Window();
final TextField<String> name = new TextField<String>();
name.setFieldLabel("Name");
w.add(name);
Button ok = new Button("OK") {
@Override
protected void onClick(ComponentEvent ce) {
w.hide();
}
};
w.add(ok);
w.show();
}
});
}
});

ColumnConfig date = new ColumnConfig("author", "Author", 300);
ColumnConfig size = new ColumnConfig("genre", "Genre", 300);
ColumnModel cm = new ColumnModel(Arrays.asList(name, date, size));

ContentPanel cp = new ContentPanel();
cp.setBodyBorder(false);
cp.setHeading("Widget Renderer TreeGrid");
cp.setButtonAlign(HorizontalAlignment.CENTER);
cp.setLayout(new FitLayout());
cp.setFrame(true);
cp.setSize(600, 300);

TreeGrid<ModelData> tree = new TreeGrid<ModelData>(store, cm);
tree.setBorders(true);
tree.setSize(400, 400);
tree.getTreeView().setBufferEnabled(false);
tree.getTreeView().setRowHeight(26);
tree.getStyle().setLeafIcon(IconHelper.createStyle("icon-music"));

cp.add(tree);

v.add(cp);

new TreeGridDragSource(tree);

TreeGridDropTarget target = new TreeGridDropTarget(tree);
target.setAllowSelfAsSource(true);
target.setFeedback(Feedback.BOTH);

RootPanel.get().add(v);
}
}

sven
23 Jul 2009, 9:29 AM
Fixed in SVN.