Added a custom controller that goes to list view after saving an item.
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
package com.yourcompany.babydatenbank.actions;
|
||||||
|
|
||||||
|
import org.openxava.actions.*;
|
||||||
|
|
||||||
|
public class SaveAndShowListAction extends SaveAction {
|
||||||
|
|
||||||
|
public void execute() throws Exception {
|
||||||
|
super.execute();
|
||||||
|
if (!getErrors().contains()) {
|
||||||
|
setNextMode(LIST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
<?xml version = "1.0" encoding = "ISO-8859-1"?>
|
<?xml version = "1.0" encoding = "ISO-8859-1"?>
|
||||||
@@ -21,5 +21,38 @@
|
|||||||
</action>
|
</action>
|
||||||
</controller>
|
</controller>
|
||||||
-->
|
-->
|
||||||
|
<controller name="BabydatenbankDefaultController">
|
||||||
|
<extends controller="Typical" excluded-actions="new, save, refresh, delete" />
|
||||||
|
|
||||||
|
<action name="new"
|
||||||
|
class="org.openxava.actions.NewAction"
|
||||||
|
image="new.gif"
|
||||||
|
icon="library-plus"
|
||||||
|
keystroke="Control N"
|
||||||
|
loses-changed-data="true">
|
||||||
|
<set property="restoreModel" value="true"/>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action
|
||||||
|
name="save" mode="detail"
|
||||||
|
class="com.yourcompany.babydatenbank.actions.SaveAndShowListAction"
|
||||||
|
by-default="if-possible"
|
||||||
|
image="save.gif"
|
||||||
|
icon="content-save"
|
||||||
|
keystroke="Control S"/>
|
||||||
|
|
||||||
|
<action name="refresh" mode="detail"
|
||||||
|
class="org.openxava.actions.SearchAction"
|
||||||
|
image="refresh.gif"
|
||||||
|
icon="refresh"
|
||||||
|
keystroke="control B"/>
|
||||||
|
|
||||||
|
<action name="delete" mode="detail" confirm="true"
|
||||||
|
class="org.openxava.actions.DeleteAction"
|
||||||
|
image="delete.gif"
|
||||||
|
icon="delete"
|
||||||
|
available-on-new="false"
|
||||||
|
keystroke="Control D"/>
|
||||||
|
</controller>
|
||||||
|
|
||||||
</controllers>
|
</controllers>
|
||||||
Reference in New Issue
Block a user