PDA

View Full Version : [FIXED] Combobox with paging loader



richard.hallier
3 Sep 2008, 6:23 AM
Version : GXT 1.1a3



RpcProxy<PagingLoadConfig, PagingLoadResult<XXX>> proxy = new ...

final PagingLoader loader = new BasePagingLoader(proxy, new BeanModelReader());

ListStore<BeanModel> store = new ListStore<BeanModel>(loader);

ComboBox cb =new ComboBox();
cb.setFieldLabel("XXX");
cb.setDisplayField("label");
cb.setStore(store);
cb.setItemSelector("div.search-item");
cb.setTriggerAction(TriggerAction.ALL);
cb.setPageSize(PAGE_SIZE);
cb.setEditable(false);
After rendering, I click on the combobox, it loads successfully and fires the Load event, and when it comes to automatically select items
listView.getSelectionModel().select(sel);the following exception appears :

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0The root cause is in 'onSelectChange' from ListView :



protected void onSelectChange(M model, boolean select) {
int index = store.indexOf(model);
if (index != -1) {
if (select) {
fly(all.getElement(index)).addStyleName(selectStyle);
} else {
fly(all.getElement(index)).removeStyleName(selectStyle);
}
}
}
'all.items' is empty, so a 'all.getElement(0)' fires the exception.

Richard

darrellmeyer
3 Sep 2008, 8:36 AM
Fix is in SVN.

richard.hallier
4 Sep 2008, 1:45 AM
Fix is in SVN.

Is it included in the alpha 4 ? because i've tested it with that version and the error is always the same

ssenecal
17 Feb 2009, 12:22 AM
Does anyone know if this issue was actually fixed or not? or perhaps the issue has crept back in? I am seeing the same behaviour, where I have a Paging store which seems to work fine except that periodically IndexOutOfBounds is being thrown (0, 0, same as this problem) as the user types. I can't actually run my code in hosted mode so I havent been able to figure out exactly where the exception is thrown from so it might not be related. However, it appears to happen when the user is typing quickly, then backspaces to make a correction.

ssenecal
17 Feb 2009, 9:12 PM
I have created a little testapp that demonstrates this issue against Ext Gwt 1.2.2. I will create a new bug and attach the app. The issue is probably different than the behaviour in this one.

ssenecal
17 Feb 2009, 9:29 PM
For anyone who wants to follow this issue, please refer to: http://extjs.com/forum/showthread.php?t=60331