I have a HTML table in a visualforce page with a custom controller that is fetch with data from the Lead object. I would like to filter the data using two filters The second filter values are dependent of the value previously selected in the first filter. How can I do that? Any sample code would be very much appreciated. Thank you!
Can you tell us more about what kind of filters you are wanting to have? Do you have any code that you can post?
Assuming your filters are actually drop down lists(Apex:SelectList), You can have the values of the second list populated based on the value selected in the first one.
Here is a simple example which shows this. http://nanostuffs.com/Blog/?p=675
You can use this same logic with any other input elements that you need.
Then you could probably have a command button which would populate(rerender) a Datatable or pageblock component with the results based on what has been selected in the two drop down lists.
More ideas on filtering datatables:
Very cool but advanced example of a dynamic datatables using JQuery. http://macscloud.com/dynamic-datatables-with-jquery-and-visualforce/