Added a custom controller that goes to list view after saving an item.

This commit is contained in:
Socrates
2020-06-10 21:45:52 +02:00
parent 95a86750e1
commit be7b319f8b
5 changed files with 48 additions and 1 deletions

View File

@@ -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.

View File

@@ -1 +1 @@
<?xml version = "1.0" encoding = "ISO-8859-1"?>
<?xml version = "1.0" encoding = "ISO-8859-1"?>

View File

@@ -21,5 +21,38 @@
</action>
</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>