ItEr58S18CUEscaladoPantallaCargaRecursosEmpresaItEr57S10:: Apply name filter to resources.
The filter is now implemented on the model, so only the resources that are going to be shown are calculated.
This commit is contained in:
parent
6d8effca44
commit
a13d8ce6b5
3 changed files with 26 additions and 1 deletions
|
|
@ -76,4 +76,8 @@ public interface IResourceLoadModel {
|
|||
|
||||
int getPageSize();
|
||||
|
||||
int getPageFilterPosition();
|
||||
|
||||
void setPageFilterPosition(int pageFilterPosition);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,8 @@ public class ResourceLoadController implements Composer {
|
|||
resourcesLoadPanel.addNameFilterListener(new IPaginationFilterChangedListener() {
|
||||
@Override
|
||||
public void filterChanged(int initialPosition) {
|
||||
resourceLoadModel.setPageFilterPosition(initialPosition);
|
||||
reload(currentFilterByResources);
|
||||
addSchedulingScreenListeners();
|
||||
}
|
||||
});
|
||||
|
|
@ -216,6 +218,7 @@ public class ResourceLoadController implements Composer {
|
|||
}
|
||||
|
||||
public void onApplyFilter(boolean filterByResources) {
|
||||
resourceLoadModel.setPageFilterPosition(0);
|
||||
reload(filterByResources);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
@Autowired
|
||||
private IConfigurationDAO configurationDAO;
|
||||
|
||||
private int pageFilterPosition = 0;
|
||||
private int pageSize = 10;
|
||||
|
||||
/**
|
||||
|
|
@ -257,7 +258,14 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
} else {
|
||||
allResourcesList = allResources();
|
||||
}
|
||||
return allResourcesList;
|
||||
if(pageFilterPosition == -1) {
|
||||
return allResourcesList;
|
||||
}
|
||||
int endPosition =
|
||||
(pageFilterPosition + pageSize < allResourcesList.size())?
|
||||
pageFilterPosition + pageSize :
|
||||
allResourcesList.size();
|
||||
return allResourcesList.subList(pageFilterPosition, endPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -270,6 +278,16 @@ public class ResourceLoadModel implements IResourceLoadModel {
|
|||
return allCriteriaList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPageFilterPosition() {
|
||||
return pageFilterPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPageFilterPosition(int pageFilterPosition) {
|
||||
this.pageFilterPosition = pageFilterPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue