Package org.openxava.actions
Class SaveAction
- java.lang.Object
-
- org.openxava.actions.BaseAction
-
- org.openxava.actions.ViewBaseAction
-
- org.openxava.actions.TabBaseAction
-
- org.openxava.actions.SaveAction
-
- All Implemented Interfaces:
IAction
,IChangeModeAction
,IModuleContextAction
,IRequestAction
public class SaveAction extends TabBaseAction
- Author:
- Javier Paniza
-
-
Field Summary
-
Fields inherited from interface org.openxava.actions.IChangeModeAction
DETAIL, LIST, PREVIOUS_MODE, SPLIT
-
-
Constructor Summary
Constructors Constructor Description SaveAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map
create()
void
execute()
protected java.util.Collection<java.lang.String>
getPropertiesToShowInEntityCreatedMessage()
Properties which values will display at the end of the message "{Entity} created successfully".protected java.util.Map
getValuesToSave()
boolean
isRefreshAfter()
If false after save does not refresh the form from database.boolean
isResetAfter()
If true reset the form after save, else refresh the form from database displayed the recently saved data.boolean
isResetAfterOnCreate()
If true reset the form after save for creating, else refresh the form from database displayed the recently saved data.boolean
isResetAfterOnModify()
If true reset the form after save for modifying, else refresh the form from database displayed the recently saved data.protected java.util.Map
modify()
void
setRefreshAfter(boolean refreshAfter)
If false after save does not refresh the form from database.void
setResetAfter(boolean b)
If true reset the form after save, else refresh the form from database displayed the recently saved data.void
setResetAfterOnCreate(boolean resetAfterOnCreate)
If true reset the form after save for creating, else refresh the form from database displayed the recently saved data.void
setResetAfterOnModify(boolean resetAfterOnModify)
If true reset the form after save for modifying, else refresh the form from database displayed the recently saved data.protected void
updateView(java.util.Map values, boolean resetAfter)
-
Methods inherited from class org.openxava.actions.TabBaseAction
getCollection, getRow, getSelected, getSelectedKeys, getTab, setCollection, setRow, setViewObject
-
Methods inherited from class org.openxava.actions.ViewBaseAction
changeThisPropertyByViewValue, closeDialog, getModelName, getPreviousView, getPreviousViews, getView, resetDescriptionsCache, returnToPreviousView, setControllers, setPreviousViews, setView, showDialog, showDialog, showNewView, showView, validateViewValues
-
Methods inherited from class org.openxava.actions.BaseAction
addActions, addError, addErrors, addInfo, addMessage, addMessages, addWarning, clearActions, commit, executeAction, executeAfter, executeBefore, getContext, getEnvironment, getErrors, getLocale, getManager, getMessages, getNextMode, getQualifiedActionIfAvailable, getRequest, removeActions, returnToPreviousControllers, rollback, setContext, setDefaultControllers, setEnvironment, setErrors, setMessages, setNextMode, setRequest
-
-
-
-
Method Detail
-
execute
public void execute() throws java.lang.Exception
- Throws:
java.lang.Exception
-
updateView
protected void updateView(java.util.Map values, boolean resetAfter)
-
modify
protected java.util.Map modify() throws java.lang.Exception
- Throws:
java.lang.Exception
-
create
protected java.util.Map create() throws java.lang.Exception
- Throws:
java.lang.Exception
-
getPropertiesToShowInEntityCreatedMessage
protected java.util.Collection<java.lang.String> getPropertiesToShowInEntityCreatedMessage() throws java.lang.Exception
Properties which values will display at the end of the message "{Entity} created successfully".
Displaying the key in the message does not always apply. The default implementation is pretty good, but you can overwrite this method to define your own properties or just return null to not show any property.- Returns:
- The properties to show or null to not show any property
- Throws:
java.lang.Exception
- Since:
- 7.0.4
-
getValuesToSave
protected java.util.Map getValuesToSave() throws java.lang.Exception
- Throws:
java.lang.Exception
-
isResetAfter
public boolean isResetAfter()
If true reset the form after save, else refresh the form from database displayed the recently saved data.The default value is true.
-
setResetAfter
public void setResetAfter(boolean b)
If true reset the form after save, else refresh the form from database displayed the recently saved data.The default value is true.
-
isRefreshAfter
public boolean isRefreshAfter()
If false after save does not refresh the form from database.It only has effect if resetAfter is false. The default value is true.
- Since:
- 4.8
-
setRefreshAfter
public void setRefreshAfter(boolean refreshAfter)
If false after save does not refresh the form from database.It only has effect if resetAfter is false. The default value is true.
- Since:
- 4.8
-
isResetAfterOnCreate
public boolean isResetAfterOnCreate()
If true reset the form after save for creating, else refresh the form from database displayed the recently saved data.The default value is true.
- Since:
- 5.8
-
setResetAfterOnCreate
public void setResetAfterOnCreate(boolean resetAfterOnCreate)
If true reset the form after save for creating, else refresh the form from database displayed the recently saved data.The default value is true.
- Since:
- 5.8
-
isResetAfterOnModify
public boolean isResetAfterOnModify()
If true reset the form after save for modifying, else refresh the form from database displayed the recently saved data.The default value is true.
- Since:
- 5.8
-
setResetAfterOnModify
public void setResetAfterOnModify(boolean resetAfterOnModify)
If true reset the form after save for modifying, else refresh the form from database displayed the recently saved data.The default value is true.
- Since:
- 5.8
-
-