+ Start a Discussion
waylonatcimwaylonatcim 

tabs, tables and custom components

I'm trying to create a section on my page that allows the user to select different views of the same information (displayed as a table) via tabs.  So the first tab (show all) will show all records for the object, the 2nd tab (show a) would show the same data in the same table but filtered to show only records of type a, the 3rd tab (show b) would be the same except for records of type b and so on. 

 

I'm trying to figure out the best way to do this without having to have what would be essentially the same code to display the table (except for the  "value" var in the pageblocktable tag) in each tab tag.  I thought about using custom components to accomplish this but I also have a requirement to have commandlinks in the table that will call a function in a controller to sort the table data and refresh.  With my ignorance of custom components I'm unsure if I can make a call to a function in the controller for the page that will be displaying the component.  

 

So the reason I'm posting is to try to understand the best practices for what I'm trying to accomplish.  If you think this could be better illustrated with some code examples please let me know and I'll supply them.

 

Thanks!