PDA

View Full Version : [FIXED] ComboBox.setForceSelection(true) throw infinite loop



xalvaro
6 May 2009, 12:21 AM
It seems that there is a bug in ComboBox.setForceSelection(true) in the last trunk version
when setting this to false, nothing happen, but when it's true, there is an infinite loop :


[ERROR] Uncaught exception escaped
java.lang.NullPointerException: null
at com.extjs.gxt.ui.client.widget.form.Field.getRawValue(Field.java:358)
at com.extjs.gxt.ui.client.widget.form.ComboBox.doForce(ComboBox.java:943)
at com.extjs.gxt.ui.client.widget.form.ComboBox.getValue(ComboBox.java:532)
at com.extjs.gxt.ui.client.widget.form.ComboBox.doForce(ComboBox.java:947)
at com.extjs.gxt.ui.client.widget.form.ComboBox.getValue(ComboBox.java:532)
at com.extjs.gxt.ui.client.widget.form.ComboBox.doForce(ComboBox.java:947)
at com.extjs.gxt.ui.client.widget.form.ComboBox.getValue(ComboBox.java:532)
at com.extjs.gxt.ui.client.widget.form.ComboBox.doForce(ComboBox.java:947)
at com.extjs.gxt.ui.client.widget.form.ComboBox.getValue(ComboBox.java:532)
at com.extjs.gxt.ui.client.widget.form.ComboBox.doForce(ComboBox.java:947)
...

my test case :



public class Test implements EntryPoint
{
class MyBeanModel extends BeanModel implements Serializable {

public MyBeanModel() {
}
public MyBeanModel(String name) {
set("name", name);
}

}

public void onModuleLoad()
{
FormPanel myFormPanel = new FormPanel();

ListStore store = new ListStore<BeanModel>();

store.add(new MyBeanModel("test1"));
store.add(new MyBeanModel("test2"));

ComboBox comboBox = new ComboBox<BeanModel>();
comboBox.setStore(store);
comboBox.setDisplayField("name");
comboBox.setForceSelection(true);
comboBox.setTriggerAction(TriggerAction.ALL);
comboBox.addSelectionChangedListener(new SelectionChangedListener<BeanModel>()
{

public void selectionChanged(SelectionChangedEvent<BeanModel> se)
{
Info.display("test", (String) se.getSelectedItem().get("name"));
}
});

myFormPanel.add(comboBox);

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

}

sven
6 May 2009, 12:24 AM
Yes, will be fixed with some ofthe next revisions.

sven
13 May 2009, 8:18 AM
Fixed in SVN