From 63a39037d3fcd3253aadd156ebe36ccd5f7da441 Mon Sep 17 00:00:00 2001 From: Gavin Cornwell Date: Wed, 8 Feb 2006 21:30:58 +0000 Subject: [PATCH] AWC-489; user list did not refresh git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2329 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../alfresco/web/bean/users/UsersBean.java | 23 +++++++++++++++---- source/web/jsp/users/users.jsp | 4 ++-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/source/java/org/alfresco/web/bean/users/UsersBean.java b/source/java/org/alfresco/web/bean/users/UsersBean.java index 045149762..e91d1890d 100644 --- a/source/java/org/alfresco/web/bean/users/UsersBean.java +++ b/source/java/org/alfresco/web/bean/users/UsersBean.java @@ -141,6 +141,11 @@ public class UsersBean implements IContextListener */ public List getUsers() { + if (this.users == null) + { + search(); + } + return this.users; } @@ -282,6 +287,9 @@ public class UsersBean implements IContextListener // commit the transaction tx.commit(); + + // re-do the search to refresh the list + search(); } catch (Throwable e) { @@ -328,9 +336,9 @@ public class UsersBean implements IContextListener /** * Event handler called when the user wishes to search for a user * - * @param event The event + * @return The outcome */ - public void search(ActionEvent event) + public String search() { this.usersRichList.setValue(null); @@ -408,19 +416,25 @@ public class UsersBean implements IContextListener try { if (tx != null) {tx.rollback();} } catch (Exception tex) {} } } + + // return null to stay on the same page + return null; } /** * Action handler to show all the users currently in the system * - * @param event The event + * @return The outcome */ - public void showAll(ActionEvent event) + public String showAll() { this.usersRichList.setValue(null); this.users = Repository.getUsers(FacesContext.getCurrentInstance(), this.nodeService, this.searchService); + + // return null to stay on the same page + return null; } // ------------------------------------------------------------------------------ @@ -434,6 +448,7 @@ public class UsersBean implements IContextListener if (this.usersRichList != null) { this.usersRichList.setValue(null); + this.users = null; } } } diff --git a/source/web/jsp/users/users.jsp b/source/web/jsp/users/users.jsp index 4a2c91451..45dea5135 100644 --- a/source/web/jsp/users/users.jsp +++ b/source/web/jsp/users/users.jsp @@ -124,8 +124,8 @@
  -   - +   +