ItEr60S04ValidacionEProbasFuncionaisItEr59S04 : [Bug #538]

it does not allow to edit the combo, that filters the resources load by name.
This commit is contained in:
Susana Montes Pedreira 2010-06-22 12:33:15 +02:00 committed by Javier Moran Rua
parent 13806a5566
commit ef5e7f69fd
2 changed files with 23 additions and 6 deletions

View file

@ -89,6 +89,7 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
private boolean refreshNameFilter = true;
private int filterByNamePosition = 0;
private int numberOfGroupsByName = 10;
private int lastSelectedName = 0;
private PaginationType paginationType;
private WeakReferencedListeners<IPaginationFilterChangedListener> nameFilterListener =
@ -409,14 +410,30 @@ public class ResourcesLoadPanel extends HtmlMacroComponent {
return groups.subList(filterByNamePosition, endPosition);
}
public void onSelectFilterByName(Integer filterByNamePosition) {
if(paginationType != PaginationType.NONE) {
this.filterByNamePosition = filterByNamePosition.intValue();
this.feedBackMessage = _("filtering by name");
changeNameFilterWithFeedback();
public void onSelectFilterByName(Combobox comboByName) {
if (comboByName.getSelectedItemApi() == null) {
resetComboByName(comboByName);
} else {
Integer filterByNamePosition = (Integer) comboByName
.getSelectedItemApi().getValue();
if (paginationType != PaginationType.NONE) {
this.filterByNamePosition = filterByNamePosition.intValue();
this.lastSelectedName = comboByName.getSelectedIndex();
this.feedBackMessage = _("filtering by name");
changeNameFilterWithFeedback();
}
}
}
private void resetComboByName(Combobox comboByName) {
if (this.lastSelectedName == -1) {
comboByName.setSelectedIndex(0);
} else {
comboByName.setSelectedIndex(this.lastSelectedName);
}
comboByName.invalidate();
}
private void changeNameFilterWithFeedback() {
LongOperationFeedback.execute(componentOnWhichGiveFeedback,
new ILongOperation() {

View file

@ -48,7 +48,7 @@ resourcesLoadPanel = self;
<separator/>
<label id="filterByNameLabel">${i18n:_('Name filter')}:</label>
<combobox id="filterByNameCombo" width="50px"
onChange="resourcesLoadPanel.onSelectFilterByName(self.selectedItemApi.value)" />
onChange="resourcesLoadPanel.onSelectFilterByName(self)" />
<separator/>
<hbox id="additionalFilterInsertionPoint2" />
</hbox>