PDA

View Full Version : ComboBoxes inside MultiField not visible in Dialog



smiletolead
13 Nov 2009, 5:09 AM
Hi all,
I am having 2 combo boxes inside a MultiField in a dialog. The combo boxes are not visible when I first open the dialog. If I move the dialog, the combo boxes appear. If the combo boxes are added directly to the layout container of the dialog, the problem does not appear. This seems to be bug.
The bug is also observed when datefield is used instead of combo box.

Regards,
Ganesh

Arno.Nyhm
13 Nov 2009, 8:22 AM
PS: you can place your code inside
tags or inside
(with highlighting) tags




package com.ca.vantage.grid.client;

import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.widget.Dialog;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.form.Field;
import com.extjs.gxt.ui.client.widget.form.MultiField;
import com.extjs.gxt.ui.client.widget.form.SimpleComboBox;
import com.extjs.gxt.ui.client.widget.layout.RowData;
import com.extjs.gxt.ui.client.widget.layout.RowLayout;
import com.google.gwt.core.client.EntryPoint;

/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class MultifieldInDialog implements EntryPoint {
private Dialog dialog;

public void onModuleLoad() {
dialog = new Dialog();

dialog.setCollapsible(true);
dialog.setWidth(400);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setShadow(false);
dialog.setHeading("Dialog");

RowLayout rl = new RowLayout();
LayoutContainer lc = new LayoutContainer(rl);
RowData logDlgRowData = new RowData();
logDlgRowData.setMargins(new Margins(4));

dialog.add(lc);

MultiField<Field<String>> multiField = new MultiField<Field<String>>();
multiField.setSpacing(10);

SimpleComboBox<String> comboLeft = new SimpleComboBox<String>();
comboLeft.add("Now");
comboLeft.add("Today");
comboLeft.add("This week");
comboLeft.add("This month");
comboLeft.add("This year");
comboLeft.setEmptyText("Now");
comboLeft.setWidth(100);
multiField.add(comboLeft);
// lc.add(todayCombo, logDlgRowData);

SimpleComboBox<String> comboRight = new SimpleComboBox<String>();
comboRight.add("Minutes");
comboRight.add("Hours");
comboRight.add("Days");
comboRight.add("Weeks");
comboRight.add("Months");
comboRight.add("Years");
comboRight.setEmptyText("Minutes");
comboRight.setWidth(100);
multiField.add(comboRight);
lc.add(multiField, logDlgRowData);
// lc.add(todayCombo, logDlgRowData);
dialog.show();
}
}

Arno.Nyhm
13 Nov 2009, 8:35 AM
i try it with setting FormLayout to dialog and also with dialog.layout().

but it not works :-(

but one thing: i see in Debug Mode for a half second the comboboxes...

something hides it :-/

Arno.Nyhm
13 Nov 2009, 8:39 AM
ok. without the rowlayout it works:



public class ForumThread408505ComboboxesInDialog implements EntryPoint {

private Dialog dialog;

public void onModuleLoad() {
dialog = new Dialog();

dialog.setCollapsible(true);
dialog.setWidth(400);
dialog.setModal(true);
dialog.setResizable(false);
dialog.setShadow(false);
dialog.setHeading("Dialog");

// RowLayout rl = new RowLayout();
// LayoutContainer lc = new LayoutContainer(rl);
LayoutContainer lc = new LayoutContainer();
// RowData logDlgRowData = new RowData();
// logDlgRowData.setMargins(new Margins(4));

dialog.add(lc);

MultiField<Field<String>> multiField = new MultiField<Field<String>>();
multiField.setSpacing(10);

SimpleComboBox<String> comboLeft = new SimpleComboBox<String>();
comboLeft.add("Now");
comboLeft.add("Today");
comboLeft.add("This week");
comboLeft.add("This month");
comboLeft.add("This year");
comboLeft.setEmptyText("Now");
comboLeft.setWidth(100);
multiField.add(comboLeft);
// lc.add(todayCombo, logDlgRowData);

SimpleComboBox<String> comboRight = new SimpleComboBox<String>();
comboRight.add("Minutes");
comboRight.add("Hours");
comboRight.add("Days");
comboRight.add("Weeks");
comboRight.add("Months");
comboRight.add("Years");
comboRight.setEmptyText("Minutes");
comboRight.setWidth(100);
multiField.add(comboRight);
// lc.add(multiField, logDlgRowData);
lc.add(multiField);
// lc.add(todayCombo, logDlgRowData);

dialog.show();
}
}


so its something with the rowlayout...

sven
13 Nov 2009, 8:56 AM
No, it is nothing with the rowlayout. It is a problem of IE. GXT 2.0.2 added a workaround for this.