Index: /trunk/grails-app/controllers/CostCodeDetailedController.groovy
===================================================================
--- /trunk/grails-app/controllers/CostCodeDetailedController.groovy	(revision 952)
+++ /trunk/grails-app/controllers/CostCodeDetailedController.groovy	(revision 953)
@@ -3,5 +3,7 @@
 @Secured(['ROLE_AppAdmin', 'ROLE_Manager'])
 class CostCodeDetailedController extends BaseController {
-    
+
+    def filterService
+
     def index = { redirect(action:list,params:params) }
 
@@ -11,5 +13,16 @@
     def list = {
         params.max = Math.min( params.max ? params.max.toInteger() : 10,  100)
-        [ costCodeInstanceList: CostCode.list( params ), costCodeInstanceTotal: CostCode.count() ]
+
+        if(!params.filter) {
+            return [costCodeInstanceList: CostCode.list(params),
+                    costCodeInstanceTotal: CostCode.count(),
+                    filterParams: params]
+        }
+
+        // filterPane:
+        return[ costCodeInstanceList: filterService.filter( params, CostCode ),
+                costCodeInstanceTotal: filterService.count( params, CostCode ),
+                filterParams: com.zeddware.grails.plugins.filterpane.FilterUtils.extractFilterParams(params),
+                params:params ]
     }
 
Index: /trunk/grails-app/views/costCodeDetailed/list.gsp
===================================================================
--- /trunk/grails-app/views/costCodeDetailed/list.gsp	(revision 952)
+++ /trunk/grails-app/views/costCodeDetailed/list.gsp	(revision 953)
@@ -1,4 +1,2 @@
-
-
 <html>
     <head>
@@ -6,4 +4,5 @@
         <meta name="layout" content="main" />
         <title>CostCode List</title>
+        <filterpane:includes />
         <nav:resources override="true"/>
     </head>
@@ -14,61 +13,90 @@
         <div class="body">
             <g:render template="/shared/messages" />
-            <div class="list">
-                <table>
-                    <thead>
+
+            <filterpane:currentCriteria domainBean="CostCode"
+                                        action="list"
+                                        dateFormat="EEE, dd-MMM-yyyy"
+                                        removeImgDir="images"
+                                        removeImgFile="bullet_delete.png"
+                                        title="Search"/>
+
+            <div class="paginateButtons">
+                Results: ${costCodeInstanceList.size()} / ${costCodeInstanceTotal}
+                <span class="searchButtons">
+                    <filterpane:filterButton text="Search" appliedText="Change Search" />
+                </span>
+            </div>
+
+            <br />
+
+            <g:if test="${costCodeInstanceList.size() > 0}">
+
+                <div class="list">
+                    <table>
+                        <thead>
                         <tr>
-                        
-                   	        <g:sortableColumn property="id" title="Id" />
-                        
-                   	        <g:sortableColumn property="name" title="Name" />
-                        
-                            <g:sortableColumn property="purchasingGroup" title="Group" />
-                        
-                   	        <g:sortableColumn property="description" title="Description" />
-                        
-                   	        <g:sortableColumn property="isActive" title="Is Active" />
+
+                            <g:sortableColumn property="id" title="Id" params="${filterParams}" />
+
+                            <g:sortableColumn property="name" title="Name" params="${filterParams}" />
+
+                            <g:sortableColumn property="purchasingGroup" title="Group" params="${filterParams}" />
+
+                            <g:sortableColumn property="description" title="Description" params="${filterParams}" />
+
+                            <g:sortableColumn property="isActive" title="Is Active" params="${filterParams}" />
 
                             <th></th>
-                        
+
                         </tr>
-                    </thead>
-                    <tbody>
-                    <g:each in="${costCodeInstanceList}" status="i" var="costCodeInstance">
-                        <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}">
-                        
-                            <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
-                                ${fieldValue(bean:costCodeInstance, field:'id')}
-                            </td>
-                        
-                            <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
-                                ${fieldValue(bean:costCodeInstance, field:'name')}
-                            </td>
-                        
-                            <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
-                                ${fieldValue(bean:costCodeInstance, field:'purchasingGroup')}
-                            </td>
-                        
-                            <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
-                                ${fieldValue(bean:costCodeInstance, field:'description')}
-                            </td>
-                        
-                            <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
-                                ${fieldValue(bean:costCodeInstance, field:'isActive')}
-                            </td>
+                        </thead>
+                        <tbody>
+                        <g:each in="${costCodeInstanceList}" status="i" var="costCodeInstance">
+                            <tr class="${(i % 2) == 0 ? 'clickableOdd' : 'clickableEven'}">
 
-                            <td class="notClickable">
-                                <g:link action="show" id="${costCodeInstance.id}">
-                                    <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
-                                </g:link>
-                            </td>
-                        
-                        </tr>
-                    </g:each>
-                    </tbody>
-                </table>
+                                <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
+                                    ${fieldValue(bean:costCodeInstance, field:'id')}
+                                </td>
+
+                                <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
+                                    ${fieldValue(bean:costCodeInstance, field:'name')}
+                                </td>
+
+                                <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
+                                    ${fieldValue(bean:costCodeInstance, field:'purchasingGroup')}
+                                </td>
+
+                                <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
+                                    ${fieldValue(bean:costCodeInstance, field:'description')}
+                                </td>
+
+                                <td onclick='window.location = "${request.getContextPath()}/costCodeDetailed/show/${costCodeInstance.id}"'>
+                                    ${fieldValue(bean:costCodeInstance, field:'isActive')}
+                                </td>
+
+                                <td class="notClickable">
+                                    <g:link action="show" id="${costCodeInstance.id}">
+                                        <img  src="${resource(dir:'images/skin',file:'database_go.png')}" alt="Show" />
+                                    </g:link>
+                                </td>
+
+                            </tr>
+                        </g:each>
+                        </tbody>
+                    </table>
+                </div>
+            </g:if>
+
+            <div class="paginateButtons">
+                <g:paginate total="${costCodeInstanceTotal}" params="${filterParams}" />
             </div>
-            <div class="paginateButtons">
-                <g:paginate total="${costCodeInstanceTotal}" />
-            </div>
+
+            <filterpane:filterPane domainBean="CostCode"
+                                   title="Search"
+                                   action="list"
+                                   class="overlayPane"
+                                   associatedProperties="purchasingGroup.name"
+                                   filterPropertyValues="${['purchasingGroup.name':[values:PurchasingGroup.findAllByIsActive(true)]]}" />
+
         </div>
     </body>
