You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by ah...@apache.org on 2023/03/31 07:30:05 UTC
[causeway] branch master updated: CAUSEWAY-3372: revert: void action return should always result in a (current) page reload
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/causeway.git
The following commit(s) were added to refs/heads/master by this push:
new de26369dab CAUSEWAY-3372: revert: void action return should always result in a (current) page reload
de26369dab is described below
commit de26369dab6d944772440a1b3ec604c8cf066b04
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Mar 31 09:29:59 2023 +0200
CAUSEWAY-3372: revert: void action return should always result in a
(current) page reload
- won't implement
---
.../ui/actionresponse/ActionResultResponseType.java | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/actionresponse/ActionResultResponseType.java b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/actionresponse/ActionResultResponseType.java
index 863625c3ca..5714d84f41 100644
--- a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/actionresponse/ActionResultResponseType.java
+++ b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/actionresponse/ActionResultResponseType.java
@@ -248,9 +248,20 @@ public enum ActionResultResponseType {
final @Nullable ManagedObject resultAdapter,
final Can<ManagedObject> args) {
- val mapAbsentResultTo = model.getAction().getReturnType().isVoid()
- ? ActionResultResponseType.VOID_AS_RELOAD
- : ActionResultResponseType.VOID_AS_EMPTY;
+ /*
+ * XXX won't implement CAUSEWAY-3372 (reload on void action result)
+ * because we found a counter example, where we don't want this behavior, that is:
+ * @Action
+ * public void delete() {
+ * repositoryService.removeAndFlush(this);
+ * }
+ */
+ val mapAbsentResultTo = /*model.getAction().getReturnType().isVoid()
+ ? ActionResultResponseType.VOID_AS_RELOAD : */
+ ActionResultResponseType.VOID_AS_EMPTY;
+ System.err.printf("model.getAction()-> %s%n", model.getAction().getFeatureIdentifier());
+ System.err.printf("model.getAction().getReturnType()-> %s%n", model.getAction().getReturnType());
+ System.err.printf("mapAbsentResultTo-> %s%n", mapAbsentResultTo);
val typeAndAdapter = determineFor(resultAdapter, mapAbsentResultTo, targetIfAny);
return typeAndAdapter.type // mapped to 'mapAbsentResultTo' if adapter is unspecified or null