added search filter.
@@ -286,6 +286,18 @@ | ||
286 | 286 | page.setRolesItems(getRoleNamesForUsername(page.getName())); |
287 | 287 | } |
288 | 288 | |
289 | + public void updateQuery(UserListPage page) | |
290 | + { | |
291 | + if (page.getFilter() != null && !page.getFilter().equals("")) | |
292 | + { | |
293 | + getUserPager().setFilter(page.getFilter()); | |
294 | + } | |
295 | + else | |
296 | + { | |
297 | + getUserPager().setFilter(""); | |
298 | + } | |
299 | + } | |
300 | + | |
289 | 301 | public List<Map<String, String>> getRoleNames() |
290 | 302 | { |
291 | 303 | return PALAdminUtil.createItems(securityProviderLogic.getRoleNames() |
@@ -45,6 +45,8 @@ | ||
45 | 45 | |
46 | 46 | private String name; |
47 | 47 | |
48 | + private String filter; | |
49 | + | |
48 | 50 | private int userIndex; |
49 | 51 | |
50 | 52 | private List<Map<String, Object>> userItems; |
@@ -61,6 +63,22 @@ | ||
61 | 63 | this.name = name; |
62 | 64 | } |
63 | 65 | |
66 | + /** | |
67 | + * @return the filter | |
68 | + */ | |
69 | + public String getFilter() | |
70 | + { | |
71 | + return filter; | |
72 | + } | |
73 | + | |
74 | + /** | |
75 | + * @param filter the filter to set | |
76 | + */ | |
77 | + public void setFilter(String filter) | |
78 | + { | |
79 | + this.filter = filter; | |
80 | + } | |
81 | + | |
64 | 82 | public int getUserIndex() |
65 | 83 | { |
66 | 84 | return userIndex; |
@@ -124,4 +142,17 @@ | ||
124 | 142 | setCrudType(CrudType.CREATE); |
125 | 143 | return UserCreatePage.class; |
126 | 144 | } |
145 | + | |
146 | + public Class doSearch() | |
147 | + { | |
148 | + getUserManagementService().updateQuery(this); | |
149 | + return null; | |
150 | + } | |
151 | + | |
152 | + public Class doResetSearch() | |
153 | + { | |
154 | + setFilter(""); | |
155 | + getUserManagementService().updateQuery(this); | |
156 | + return null; | |
157 | + } | |
127 | 158 | } |
@@ -35,6 +35,13 @@ | ||
35 | 35 | </div> |
36 | 36 | |
37 | 37 | <div> |
38 | + <label id="filterLabel" class="portlet-form-label">Filter:</label> | |
39 | + <input type="text" id="filter" size="15"/> | |
40 | + <input type="button" id="doSearch" value="Search" onclick="location.href='userList.html'" class="portlet-form-button"/> | |
41 | + <input type="button" id="doResetSearch" value="Reset" onclick="location.href='userList.html'" class="portlet-form-button"/><br/> | |
42 | + </div> | |
43 | + | |
44 | + <div> | |
38 | 45 | <span id="count-header">10</span><!-- TODO: i18n--> <label id="foundLabel"> found.</label> |
39 | 46 | (<span id="currentPageNumber-header">3</span>/<span id="maxPageNumber-header">5</span>) |
40 | 47 | </div> |