PDA

View Full Version : ComboBox problem with large maxHeight



hulseware
18 Sep 2010, 12:45 PM
In 2.2.0, if a ComboBox has a large enough maxHeight to make the list move from the bottom of the text field of the combo box, all the user gets is a drop shadow where the list should appear. When I first tried to attach a screenshot, it was too big, so i resized the window to be smaller and when I clicked the arrow on the combo box, I got the drop shadow, but also got some of the data from the list this time. I believe this problem showed up with 2.2.0.

sven
19 Sep 2010, 3:28 AM
I cannot reproduce this. Are you sure that there is no exception somewhere? Can you please try to post some small testcase that implements EntryPoint and shows your problem?

hulseware
19 Sep 2010, 6:00 AM
Here's my test program. This demonstrates both problems on my system. You referred to upgrading the resources - I'm assuming that means overlaying my public area with everything in the resources directory of the distribution to get all the current css, etc.



/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.cat.client.simple;

import com.extjs.gxt.ui.client.data.BaseModelData;
import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.store.ListStore;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.form.ComboBox;
import com.extjs.gxt.ui.client.widget.form.FormPanel;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

/**
*
* @author bhulse
*/
public class ComboBoxBug implements EntryPoint {

@Override
public void onModuleLoad() {
FormPanel cp = new FormPanel();
cp.setLabelSeparator(":");
cp.setAutoHeight(false);
cp.setHeight(500);
cp.setAutoWidth(false);
cp.setWidth(600);

ListStore<ModelData> store = new ListStore<ModelData>();
for (int i = 0; i < 100; i++) {
ModelData model = new BaseModelData();
model.set("value", String.valueOf(i));
model.set("display", "Display " + String.valueOf(i));
store.add(model);
}
TextField text1 = new TextField();
text1.setFieldLabel("Text Field 1");

TextField text2 = new TextField();
text2.setFieldLabel("Text Field 2");

TextField text3 = new TextField();
text3.setFieldLabel("Text Field 3");

ComboBox combo = new ComboBox();
combo.setFieldLabel("Combo Box");
combo.setValueField("value");
combo.setDisplayField("display");
// Reverse the order of these two to see the drop shadow (450) or the missing scrollbars (250)
combo.setMaxHeight(250);
combo.setMaxHeight(450);
combo.setStore(store);

cp.add(text1);
cp.add(text2);
cp.add(text3);
cp.add(combo);
RootPanel.get().add(cp);
}
}

sven
19 Sep 2010, 6:05 AM
I tested this with both orders and it works fine for me against GXT 2.2

sven
19 Sep 2010, 6:07 AM
250:
http://www.svenbrunken.de/images/screenshots/SS-2010.09.19-16.05.59.png

450:
http://www.svenbrunken.de/images/screenshots/SS-2010.09.19-16.06.51.png

lbrunner
4 Oct 2010, 4:59 AM
Hi !
Too bad there is no follow-up on this issue, as I also experience something in the way. In my case it's a dialog window which has the Combo box. When I place the dialog window too close to the bottom of the page, the same issue happens: only the shadow of the combo appears and not the combo itself. I checked with Firebug but I could not identify any anormality. Hopefully hulseware (http://www.sencha.com/forum/member.php?166216-hulseware) has a hint for the resolution!

hulseware
4 Oct 2010, 6:02 AM
When I upgraded, I had forgotten to copy the contents of the resource directory into my source tree. Once I did that and rebuilt the GXT app, the problems all went away. Sorry for not putting the answer on the forum earlier.

lbrunner
4 Oct 2010, 6:04 AM
Thank you anyway!

lbrunner
4 Oct 2010, 7:39 AM
The problem seems to be linked to the positioning of the combo box, when there isn't enough space neither on top nor on the bottom of the combo box. In my case reducing its size with setMaxHeight() did the job.

sven
4 Oct 2010, 7:48 AM
I did a change to combobox so the list can never be bigger than the window height, will be part of GXT 2.2.1