. Fix to paging (refresh) issue in Rules and Manage Space/Content Users screens

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2483 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-02-23 15:51:31 +00:00
parent 16f566d257
commit 1c1dfb53ae
4 changed files with 78 additions and 10 deletions

View File

@@ -31,6 +31,8 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.rule.Rule;
import org.alfresco.service.cmr.rule.RuleService;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.IContextListener;
import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink;
@@ -44,7 +46,7 @@ import org.apache.commons.logging.LogFactory;
*
* @author gavinc
*/
public class RulesBean
public class RulesBean implements IContextListener
{
private static final String MSG_ERROR_DELETE_RULE = "error_delete_rule";
private static final String LOCAL = "local";
@@ -59,6 +61,15 @@ public class RulesBean
private Rule currentRule;
private UIRichList richList;
/**
* Default constructor
*/
public RulesBean()
{
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
}
/**
* Returns the current view mode the list of rules is in
*
@@ -122,6 +133,9 @@ public class RulesBean
this.currentRule = this.ruleService.getRule(
getSpace().getNodeRef(), id);
// refresh list
contextUpdated();
}
}
@@ -201,7 +215,6 @@ public class RulesBean
public void setRichList(UIRichList richList)
{
this.richList = richList;
this.richList.setValue(null);
}
/**
@@ -229,6 +242,22 @@ public class RulesBean
{
this.ruleService = ruleService;
}
// ------------------------------------------------------------------------------
// IContextListener implementation
/**
* @see org.alfresco.web.app.context.IContextListener#contextUpdated()
*/
public void contextUpdated()
{
if (this.richList != null)
{
this.richList.setValue(null);
}
}
/**
* Inner class to wrap the Rule objects so we can expose a flag to indicate whether

View File

@@ -45,6 +45,8 @@ import org.alfresco.service.cmr.security.OwnableService;
import org.alfresco.service.cmr.security.PermissionService;
import org.alfresco.service.cmr.security.PersonService;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.context.IContextListener;
import org.alfresco.web.app.context.UIContextService;
import org.alfresco.web.bean.BrowseBean;
import org.alfresco.web.bean.repository.MapNode;
import org.alfresco.web.bean.repository.Node;
@@ -57,7 +59,7 @@ import org.alfresco.web.ui.repo.WebResources;
/**
* @author Kevin Roast
*/
public abstract class UserMembersBean
public abstract class UserMembersBean implements IContextListener
{
private static final String MSG_SUCCESS_INHERIT_NOT = "success_not_inherit_permissions";
private static final String MSG_SUCCESS_INHERIT = "success_inherit_permissions";
@@ -100,6 +102,15 @@ public abstract class UserMembersBean
private List<PermissionWrapper> personRoles = null;
/**
* Default constructor
*/
public UserMembersBean()
{
UIContextService.getInstance(FacesContext.getCurrentInstance()).registerBean(this);
}
// ------------------------------------------------------------------------------
// Abstract methods
@@ -176,9 +187,6 @@ public abstract class UserMembersBean
public void setUsersRichList(UIRichList usersRichList)
{
this.usersRichList = usersRichList;
// force refresh on exit of the page (as this property is set by JSF on view restore)
this.usersRichList.setValue(null);
}
/**
@@ -395,9 +403,32 @@ public abstract class UserMembersBean
}
// ------------------------------------------------------------------------------
// IContextListener implementation
/**
* @see org.alfresco.web.app.context.IContextListener#contextUpdated()
*/
public void contextUpdated()
{
if (this.usersRichList != null)
{
this.usersRichList.setValue(null);
}
}
// ------------------------------------------------------------------------------
// Action event handlers
/**
* Action called to Close the dialog
*/
public void close(ActionEvent event)
{
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
}
/**
* Action event called by all actions that need to setup a Person context on
* the UserMembers bean before an action page is called. The context will be a
@@ -465,9 +496,11 @@ public abstract class UserMembersBean
{
setPersonAuthority(null);
}
// force refresh on return to this page
contextUpdated();
}
/**
* Inherit parent Space permissions value changed by the user
*/
@@ -514,6 +547,9 @@ public abstract class UserMembersBean
PermissionWrapper wrapper = new PermissionWrapper(role, Application.getMessage(context, role));
this.personRoles.add(wrapper);
}
// force refresh on return to this page
contextUpdated();
}
/**
@@ -526,6 +562,9 @@ public abstract class UserMembersBean
{
this.personRoles.remove(wrapper);
}
// force refresh on return to this page
contextUpdated();
}
/**

View File

@@ -171,7 +171,7 @@
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" actionListener="#{ContentUsersBean.users}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>

View File

@@ -171,7 +171,7 @@
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
<h:commandButton value="#{msg.close}" actionListener="#{SpaceUsersBean.close}" action="dialog:close" styleClass="wizardButton" />
</td>
</tr>
</table>