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 0941ef5885 CAUSEWAY-3727: force parameters to RenderScenario.EDITING
0941ef5885 is described below
commit 0941ef58857bc43846475e87f0d669cba8932921
Author: andi-huber <[email protected]>
AuthorDate: Thu Apr 25 18:03:25 2024 +0200
CAUSEWAY-3727: force parameters to RenderScenario.EDITING
- parameter editing is either initially vetoed or not; but params must
always support dynamic switching between VIEWING and EDITING; as
governed by Action Parameter Support Methods
---
.../ui/components/scalars/ScalarPanelAbstract.java | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git
a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java
b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java
index 2dd94ef6f1..8c1090f058 100644
---
a/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java
+++
b/viewers/wicket/ui/src/main/java/org/apache/causeway/viewer/wicket/ui/components/scalars/ScalarPanelAbstract.java
@@ -101,6 +101,9 @@ implements ScalarModelChangeListener {
}
public enum RenderScenario {
+ /**
+ * As used for table cell content.
+ */
COMPACT,
/**
* Is viewing and cannot edit.
@@ -131,25 +134,20 @@ implements ScalarModelChangeListener {
return this==CAN_EDIT
|| this==CAN_EDIT_INLINE
|| this==CAN_EDIT_INLINE_VIA_ACTION; }
-
+
static RenderScenario inferFrom(final ScalarPanelAbstract scalarPanel)
{
val scalarModel = scalarPanel.scalarModel();
if(scalarModel.getRenderingHint().isInTable()) {
return COMPACT;
}
- if(scalarModel.isParameter()
- && !(scalarPanel instanceof ScalarPanelSelectAbstract)
- && scalarModel.disabledReason().isPresent()) {
- /* this simple logic only applies for params, as those don't
support inline-as-if-edit
- * however, our select2 component does not allow for dynamic
switching of usability,
- * so it must not be initialized readonly here */
- return READONLY;
+ if(scalarModel.isParameter()) {
+ return _Util.canParameterEnterNestedEdit(scalarModel)
+ ? EDITING_WITH_LINK_TO_NESTED // nested/embedded dialog
+ : EDITING; // for params always EDITING even if
editing is vetoed
}
+ // at this point we are processing a property (not a parameter)
if(scalarModel.isEditingMode()) {
- return
- _Util.canParameterEnterNestedEdit(scalarModel)
- ? EDITING_WITH_LINK_TO_NESTED // nested/embedded dialog
- : EDITING;
+ return EDITING;
}
if(_Util.canPropertyEnterInlineEditDirectly(scalarModel)) {
return CAN_EDIT_INLINE;