You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2017/07/30 16:56:18 UTC

[1/2] isis git commit: ISIS-1668: only enables prompt if the associated action is visible and enabled.

Repository: isis
Updated Branches:
  refs/heads/master 798a2c396 -> 0c6c16d06


ISIS-1668: only enables prompt if the associated action is visible and enabled.

Note that this still leaves ISIS-1670 (view is not dynamic)... but since ISIS-1670 was a problem even for regular editable properties, decided that the fix in this commit addresses ISIS-1668 sufficiently.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/05a6624d
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/05a6624d
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/05a6624d

Branch: refs/heads/master
Commit: 05a6624d797e4b4236e672500e0a5f45cca7f852
Parents: 798a2c3
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sun Jul 30 17:21:01 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sun Jul 30 17:21:01 2017 +0100

----------------------------------------------------------------------
 .../wicket/ui/components/scalars/ScalarPanelAbstract2.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/05a6624d/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java
index 0eccc24..1ba6fba 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java
@@ -286,8 +286,10 @@ public abstract class ScalarPanelAbstract2 extends PanelAbstract<ScalarModel> im
                     // safe to do this, the inlineAsEditIfAny(...) method checks for us
                     final ActionLink actionLinkInlineAsIfEdit = (ActionLink) linkAndLabelAsIfEdit.getLink();
 
-                    configureInlinePromptLinkCallback(inlinePromptLink, actionLinkInlineAsIfEdit);
-                    componentToHideIfAny = inlinePromptConfig.getComponentToHideIfAny();
+                    if(actionLinkInlineAsIfEdit.isVisible() && actionLinkInlineAsIfEdit.isEnabled()) {
+                        configureInlinePromptLinkCallback(inlinePromptLink, actionLinkInlineAsIfEdit);
+                        componentToHideIfAny = inlinePromptConfig.getComponentToHideIfAny();
+                    }
 
                     // don't render as an action
                     linkAndLabels = Lists.newArrayList(linkAndLabels);


[2/2] isis git commit: ISIS-1668: prevents any action annotated as INLINE_AS_IF_EDIT to be shown as a button.

Posted by da...@apache.org.
ISIS-1668: prevents any action annotated as INLINE_AS_IF_EDIT to be shown as a button.

Previously if the property was itself editable, then the action would be shown as a button.  This changes the behaviour so that the action is never rendered as an button.


Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/0c6c16d0
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/0c6c16d0
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/0c6c16d0

Branch: refs/heads/master
Commit: 0c6c16d06ec4bd907b045e7d116556b510c7a43d
Parents: 05a6624
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sun Jul 30 17:51:47 2017 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sun Jul 30 17:51:47 2017 +0100

----------------------------------------------------------------------
 .../components/scalars/ScalarPanelAbstract2.java  | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/isis/blob/0c6c16d0/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java
----------------------------------------------------------------------
diff --git a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java
index 1ba6fba..51f83d8 100644
--- a/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java
+++ b/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/ScalarPanelAbstract2.java
@@ -269,16 +269,17 @@ public abstract class ScalarPanelAbstract2 extends PanelAbstract<ScalarModel> im
             // are using inline prompts
             Component componentToHideIfAny = inlinePromptLink;
 
+            // check if one of the associated actions is configured to use an inline form "as if edit"
+            final LinkAndLabel linkAndLabelAsIfEdit = inlineAsIfEditIfAny(linkAndLabels);
+
             if (this.scalarModel.getPromptStyle().isInline() && scalarModel.canEnterEditMode()) {
                 // we configure the prompt link if _this_ property is configured for inline edits...
                 configureInlinePromptLinkCallback(inlinePromptLink);
                 componentToHideIfAny = inlinePromptConfig.getComponentToHideIfAny();
 
             } else {
-                // even though the property isn't editable, it might be that one of the associated actions
-                // is configured to use an inline form "as if edit"
-                final LinkAndLabel linkAndLabelAsIfEdit = inlineAsIfEditIfAny(linkAndLabels);
 
+                // not editable property, but maybe one of the actions is.
                 if(linkAndLabelAsIfEdit != null) {
 
                     scalarModel.setHasActionWithInlineAsIfEdit(true);
@@ -290,13 +291,16 @@ public abstract class ScalarPanelAbstract2 extends PanelAbstract<ScalarModel> im
                         configureInlinePromptLinkCallback(inlinePromptLink, actionLinkInlineAsIfEdit);
                         componentToHideIfAny = inlinePromptConfig.getComponentToHideIfAny();
                     }
-
-                    // don't render as an action
-                    linkAndLabels = Lists.newArrayList(linkAndLabels);
-                    linkAndLabels.remove(linkAndLabelAsIfEdit);
                 }
             }
 
+            if(linkAndLabelAsIfEdit != null) {
+                // irrespective of whether the property is itself editable, if the action is annotated as
+                // INLINE_AS_IF_EDIT then we never render it as an action
+                linkAndLabels = Lists.newArrayList(linkAndLabels);
+                linkAndLabels.remove(linkAndLabelAsIfEdit);
+            }
+
             if(componentToHideIfAny != null) {
                 componentToHideIfAny.setVisibilityAllowed(false);
             }