mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Added check for duplicate form submissions to dialog/wizard framework
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2736 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -23,6 +23,8 @@ import org.alfresco.web.ui.common.Utils;
|
|||||||
*/
|
*/
|
||||||
public abstract class BaseDialogBean implements IDialogBean
|
public abstract class BaseDialogBean implements IDialogBean
|
||||||
{
|
{
|
||||||
|
protected boolean isFinished = false;
|
||||||
|
|
||||||
// services common to most dialogs
|
// services common to most dialogs
|
||||||
protected BrowseBean browseBean;
|
protected BrowseBean browseBean;
|
||||||
protected NavigationBean navigator;
|
protected NavigationBean navigator;
|
||||||
@@ -34,6 +36,9 @@ public abstract class BaseDialogBean implements IDialogBean
|
|||||||
{
|
{
|
||||||
// tell any beans to update themselves so the UI gets refreshed
|
// tell any beans to update themselves so the UI gets refreshed
|
||||||
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
|
UIContextService.getInstance(FacesContext.getCurrentInstance()).notifyBeans();
|
||||||
|
|
||||||
|
// reset the isFinished flag
|
||||||
|
this.isFinished = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String cancel()
|
public String cancel()
|
||||||
@@ -45,6 +50,11 @@ public abstract class BaseDialogBean implements IDialogBean
|
|||||||
{
|
{
|
||||||
String outcome = getDefaultFinishOutcome();
|
String outcome = getDefaultFinishOutcome();
|
||||||
|
|
||||||
|
// check the isFinished flag to stop the finish button
|
||||||
|
// being pressed multiple times
|
||||||
|
if (this.isFinished == false)
|
||||||
|
{
|
||||||
|
this.isFinished = true;
|
||||||
UserTransaction tx = null;
|
UserTransaction tx = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -70,6 +80,7 @@ public abstract class BaseDialogBean implements IDialogBean
|
|||||||
Utils.addErrorMessage(formatErrorMessage(e));
|
Utils.addErrorMessage(formatErrorMessage(e));
|
||||||
outcome = null;
|
outcome = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return outcome;
|
return outcome;
|
||||||
}
|
}
|
||||||
|
@@ -2,8 +2,6 @@ package org.alfresco.web.bean.wizard;
|
|||||||
|
|
||||||
import javax.faces.context.FacesContext;
|
import javax.faces.context.FacesContext;
|
||||||
|
|
||||||
import org.alfresco.service.cmr.model.FileFolderService;
|
|
||||||
import org.alfresco.service.cmr.search.SearchService;
|
|
||||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
import org.alfresco.web.bean.dialog.BaseDialogBean;
|
||||||
|
Reference in New Issue
Block a user