Without seeing how you are doing things (and assuming you may be using the same controller) your options would be:
Using a dynamic query in the controller:
- use
apexPages.currentPage().getURL()
and determine the page - Based on the page set the where clause of the query
or
- Use a URL parameter say 'filterOn' as set it when calling the page:
either way you get the idea from the code below.
public string filterOn;
public className(){
filterOn = apexPages.currentPage().getParameters().get('filterOn');
}
public DATATYPE[] getmyMethod(){
String qry = 'Select xxx from xxx ';
if(!string.isBlnak(filterOn)
tryqry += ' Where FILENAME = :filterOn';
return database.query(tryqry);
}
Note you will get a much better and more direct answer if you post your code :)