PDA

View Full Version : [OPEN] [FIXED] GXT 1.2.3, Safari and ComboBox on FormPanel



pepez
6 Apr 2009, 2:09 AM
If a ComboBox is placed on the FormPanel, it is rendered wrong on Safari 3 (both windows and mac). Same works fine on FF. Replacing FormPanel with VerticalPanel fixes the rendering problem.


FormPanel panel = new FormPanel();
ComboBox<ModelData> selection = new ComboBox<ModelData>();

selection .setTemplate(getTemplate());
selection .setDisplayField("name");
selection .setForceSelection(true);
selection .setWidth(495);
selection .setEditable(false);
panel.add(_selectedTemplate);
private native String getTemplate() /*-{
return [
'<tpl for=".">',
'<div class="x-combo-list-item">{name}</div>',
'</tpl>'
].join("");
}-*/;

sven
6 Apr 2009, 2:20 AM
Can you please post a complete testcase and not only a simple codesnippet? I am unable to reproduce this.

pepez
6 Apr 2009, 3:06 AM
public void onModuleLoad() {
final Window w = new Window();
w.setWidth(640);
w.setHeight(480);
w.setLayout(new FitLayout());
w.setBodyStyle("backgroundColor: white;");
w.setMaximizable(true);
final FormPanel panel = new FormPanel();
panel.setWidth("100%");
panel.setBorders(false);
panel.setBodyBorder(false);
panel.setHeaderVisible(false);

w.add(panel);

final ComboBox<ModelData> test =
new ComboBox<ModelData>();

test.setFieldLabel("test");
test.setTemplate(getTemplate());
test.setId("default");
test.setDisplayField("name");
test.setForceSelection(true);
test.setEditable(false);

panel.add(test, new FormData("95%"));

final ListStore<ModelData> store = new ListStore<ModelData>();
final ModelData first = new BaseModelData();
first.set("name", "first");
store.add(first);
final ModelData second = new BaseModelData();
second.set("name", "second");
store.add(second);
final ModelData none = new BaseModelData();
none.set("name", "{none}");
store.add(none);

test.setStore(store);

w.show();
}

sven
6 Apr 2009, 3:10 AM
This is already fixed in SVN.

pepez
6 Apr 2009, 3:16 AM
Good to hear - thank you!