Hi,
Just noticed that calling updateFilterList on it's own, after an async filtering, it's not doing the job. The popup is not showing, even if the list is not emtpy. I suppose this happens because it's not calculating the new popup height.
It only works when it's called after the filterImpl, via the setText method, because that takes care of adjusting the height.
So I guess a fix would be adding the section from filterImpl into updateFilterList as well, for cases when the update is called on its own.
The section I'm referring to:
if (popup.getComponentCount() > 0) {
int popupHeight = calcPopupHeight((List)popup.getComponentAt(0));
popup.setHeight(popupHeight);
dontCalcSize = false;
popup.forceRevalidate();
dontCalcSize = true;
}
Below you have the current updateFilterList and filterImpl contents:
protected void updateFilterList() {
Form f = getComponentForm();
boolean v = filter.getSize() > 0 && getText().length() >= minimumLength;
if(v != popup.isVisible()) {
if(popup.getComponentCount() > 0) {popup.getComponentAt(0).setScrollY(0);}
popup.setVisible(v);
popup.setEnabled(v);
f.repaint();
}
if(f != null) {
dontCalcSize = false;
f.revalidate();
dontCalcSize = true;
}
}
private boolean filterImpl(String text) {
boolean res = filter(text);
if(filter != null && popup != null) {
boolean v = filter.getSize() > 0 && text.length() >= minimumLength;
if(v != popup.isVisible() && popup.getComponentCount() > 0) {
popup.getComponentAt(0).setScrollY(0);
popup.setVisible(v);
popup.setEnabled(v);
}
Form f = getComponentForm();
if (popup.getComponentCount() > 0) {
int popupHeight = calcPopupHeight((List)popup.getComponentAt(0));
popup.setHeight(popupHeight);
dontCalcSize = false;
popup.forceRevalidate();
dontCalcSize = true;
}
if (f != null) {
f.repaint();
}
}
return res;
}
Hi,
Just noticed that calling updateFilterList on it's own, after an async filtering, it's not doing the job. The popup is not showing, even if the list is not emtpy. I suppose this happens because it's not calculating the new popup height.
It only works when it's called after the filterImpl, via the setText method, because that takes care of adjusting the height.
So I guess a fix would be adding the section from filterImpl into updateFilterList as well, for cases when the update is called on its own.
The section I'm referring to:
Below you have the current updateFilterList and filterImpl contents: